impl

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultStore

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

DefaultStore : OAuth2用のデフォルトのデータストア(mysql)

func NewDefaultStore

func NewDefaultStore(db *gorm.DB) (*DefaultStore, error)

NewDefaultStore OAuth2用のデフォルトのデータストアを生成します

func (*DefaultStore) DeleteAuthorize

func (s *DefaultStore) DeleteAuthorize(code string) error

DeleteAuthorize : 認可コードから認可データを削除します

func (*DefaultStore) DeleteClient

func (s *DefaultStore) DeleteClient(id string) error

DeleteClient : クライアントを削除します

func (*DefaultStore) DeleteTokenByAccess

func (s *DefaultStore) DeleteTokenByAccess(access string) error

DeleteTokenByAccess : アクセストークンからトークンを削除します

func (*DefaultStore) DeleteTokenByClient

func (s *DefaultStore) DeleteTokenByClient(clientID string) error

DeleteTokenByClient : 指定したクライアントのトークンを全て削除します

func (*DefaultStore) DeleteTokenByID

func (s *DefaultStore) DeleteTokenByID(id uuid.UUID) error

DeleteTokenByID : トークンIDからトークンを削除します

func (*DefaultStore) DeleteTokenByRefresh

func (s *DefaultStore) DeleteTokenByRefresh(refresh string) error

DeleteTokenByRefresh : リフレッシュトークンからトークンを削除します

func (*DefaultStore) DeleteTokenByUser

func (s *DefaultStore) DeleteTokenByUser(userID uuid.UUID) error

DeleteTokenByUser : 指定したユーザーのトークンを全て削除します

func (*DefaultStore) GetAuthorize

func (s *DefaultStore) GetAuthorize(code string) (*oauth2.AuthorizeData, error)

GetAuthorize : 認可コードから認可データを取得します

func (*DefaultStore) GetClient

func (s *DefaultStore) GetClient(id string) (*oauth2.Client, error)

GetClient : クライアントIDからクライアントを取得します

func (*DefaultStore) GetClientsByUser

func (s *DefaultStore) GetClientsByUser(userID uuid.UUID) ([]*oauth2.Client, error)

GetClientsByUser : 指定した登録者のクライアントを全て取得します

func (*DefaultStore) GetTokenByAccess

func (s *DefaultStore) GetTokenByAccess(access string) (*oauth2.Token, error)

GetTokenByAccess : アクセストークンからトークンを取得します

func (*DefaultStore) GetTokenByID

func (s *DefaultStore) GetTokenByID(id uuid.UUID) (*oauth2.Token, error)

GetTokenByID : トークンIDからトークンを取得します

func (*DefaultStore) GetTokenByRefresh

func (s *DefaultStore) GetTokenByRefresh(refresh string) (*oauth2.Token, error)

GetTokenByRefresh : リフレッシュトークンからトークンを取得します

func (*DefaultStore) GetTokensByUser

func (s *DefaultStore) GetTokensByUser(userID uuid.UUID) ([]*oauth2.Token, error)

GetTokensByUser : 指定したユーザーのトークンを全て取得します

func (*DefaultStore) SaveAuthorize

func (s *DefaultStore) SaveAuthorize(data *oauth2.AuthorizeData) error

SaveAuthorize : 認可データを保存します

func (*DefaultStore) SaveClient

func (s *DefaultStore) SaveClient(client *oauth2.Client) error

SaveClient : クライアントを保存します

func (*DefaultStore) SaveToken

func (s *DefaultStore) SaveToken(token *oauth2.Token) error

SaveToken : トークンを保存します

func (*DefaultStore) UpdateClient

func (s *DefaultStore) UpdateClient(client *oauth2.Client) error

UpdateClient : クライアント情報を更新します

type OAuth2Authorize

type OAuth2Authorize struct {
	Code                string    `gorm:"type:varchar(36);primary_key"`
	ClientID            string    `gorm:"type:char(36)"`
	UserID              uuid.UUID `gorm:"type:char(36)"`
	ExpiresIn           int
	RedirectURI         string    `gorm:"type:text"`
	Scopes              string    `gorm:"type:text"`
	OriginalScopes      string    `gorm:"type:text"`
	CodeChallenge       string    `gorm:"type:varchar(128)"`
	CodeChallengeMethod string    `gorm:"type:text"`
	Nonce               string    `gorm:"type:text"`
	CreatedAt           time.Time `gorm:"precision:6"`
}

OAuth2Authorize OAuth2 認可データの構造体

func (*OAuth2Authorize) TableName

func (*OAuth2Authorize) TableName() string

TableName OAuth2Authorizeのテーブル名

type OAuth2Client

type OAuth2Client struct {
	ID           string `gorm:"type:char(36);primary_key"`
	Name         string `gorm:"type:varchar(32)"`
	Description  string `gorm:"type:text"`
	Confidential bool
	CreatorID    uuid.UUID  `gorm:"type:char(36)"`
	Secret       string     `gorm:"type:varchar(36)"`
	RedirectURI  string     `gorm:"type:text"`
	Scopes       string     `gorm:"type:text"`
	CreatedAt    time.Time  `gorm:"precision:6"`
	UpdatedAt    time.Time  `gorm:"precision:6"`
	DeletedAt    *time.Time `gorm:"precision:6"`
}

OAuth2Client OAuth2 クライアント構造体

func (*OAuth2Client) TableName

func (*OAuth2Client) TableName() string

TableName OAuth2Clientのテーブル名

type OAuth2Token

type OAuth2Token struct {
	ID           uuid.UUID `gorm:"type:char(36);primary_key"`
	ClientID     string    `gorm:"type:char(36)"`
	UserID       uuid.UUID `gorm:"type:char(36)"`
	RedirectURI  string    `gorm:"type:text"`
	AccessToken  string    `gorm:"type:varchar(36);unique"`
	RefreshToken string    `gorm:"type:varchar(36);unique"`
	Scopes       string    `gorm:"type:text"`
	ExpiresIn    int
	CreatedAt    time.Time  `gorm:"precision:6"`
	DeletedAt    *time.Time `gorm:"precision:6"`
}

OAuth2Token : OAuth2 トークンの構造体

func (*OAuth2Token) TableName

func (*OAuth2Token) TableName() string

TableName : OAuth2Tokenのテーブル名

Jump to

Keyboard shortcuts

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