oauth2

package
v0.0.0-...-01681b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthorizeDataNotFound = errors.New("AuthorizeData not found")
	ErrAccessDataNotFound    = errors.New("AccessData not found")
)

Functions

func InitDatabase

func InitDatabase(ctx *models.Context)

func NewTestHelper

func NewTestHelper(t *testing.T) testhelper.TestHelper

Types

type AccessData

type AccessData struct {
	Id              int
	AppId           int    `db:"app_id"`
	AuthorizeDataId int    `db:"authorize_data_id"`
	AccessDataId    int    `db:"access_data_id"`
	AccessToken     string `db:"access_token"`
	RefreshToken    string `db:"refresh_token"`
	ExpiresIn       int32  `db:"expires_in"`
	Scope           string
	RedirectUri     string `db:"redirect_uri"`
	Created         string
	UserId          int `db:"user_id"`
}

func (AccessData) CreatedTime

func (ad AccessData) CreatedTime() time.Time

type AccessUserData

type AccessUserData struct {
	AccessDataId int
	UserId       int
}

type AuthorizeData

type AuthorizeData struct {
	Id          int
	AppId       int `db:"app_id"`
	Code        string
	ExpiresIn   int32 `db:"expires_in"`
	Scope       string
	RedirectUri string `db:"redirect_uri"`
	State       string
	Created     string
	UserId      int `db:"user_id"`
}

func (AuthorizeData) CreatedTime

func (ad AuthorizeData) CreatedTime() time.Time

type AuthorizeUserData

type AuthorizeUserData struct {
	AuthorizeDataId int
	UserId          int
}

type Refresh

type Refresh struct {
	Id           int
	RefreshToken string `db:"refresh_token"`
	AccessToken  string `db:"access_token"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewOAuth2Storage

func NewOAuth2Storage(ctx *models.Context) *Storage

func (*Storage) Clone

func (s *Storage) Clone() osin.Storage

func (*Storage) Close

func (s *Storage) Close()

func (*Storage) GetClient

func (s *Storage) GetClient(id string) (osin.Client, error)

func (*Storage) LoadAccess

func (s *Storage) LoadAccess(code string) (*osin.AccessData, error)

func (*Storage) LoadAuthorize

func (s *Storage) LoadAuthorize(code string) (*osin.AuthorizeData, error)

func (*Storage) LoadRefresh

func (s *Storage) LoadRefresh(code string) (*osin.AccessData, error)

func (*Storage) RemoveAccess

func (s *Storage) RemoveAccess(code string) error

func (*Storage) RemoveAuthorize

func (s *Storage) RemoveAuthorize(code string) error

func (*Storage) RemoveRefresh

func (s *Storage) RemoveRefresh(code string) error

func (*Storage) SaveAccess

func (s *Storage) SaveAccess(data *osin.AccessData) error

func (*Storage) SaveAuthorize

func (s *Storage) SaveAuthorize(data *osin.AuthorizeData) error

func (*Storage) SetClient

func (s *Storage) SetClient(id string, client osin.Client) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL