Documentation
¶
Index ¶
- type OauthRepository
- func (self *OauthRepository) CleanTokenStore(ctx context.Context) (result error)
- func (self *OauthRepository) CreateAuthCode(ctx context.Context, code, clientID, scope string, user *ent.User, ...) (*ent.Oauth2Code, error)
- func (self *OauthRepository) CreateToken(ctx context.Context, accessToken, refreshToken, clientID, scope string, ...) (*ent.Oauth2Token, error)
- func (self *OauthRepository) DeleteAuthCode(ctx context.Context, code string) error
- func (self *OauthRepository) GetAuthCode(ctx context.Context, code string) (*ent.Oauth2Code, error)
- func (self *OauthRepository) GetByAccessToken(ctx context.Context, accessToken string) (*ent.Oauth2Token, error)
- func (self *OauthRepository) GetByRefreshToken(ctx context.Context, refreshToken string) (*ent.Oauth2Token, error)
- func (self *OauthRepository) GetOrGenerateJWTPrivateKey(ctx context.Context) (*rsa.PrivateKey, []byte, error)
- func (self *OauthRepository) RevokeAccessToken(ctx context.Context, accessToken string) error
- func (self *OauthRepository) RevokeRefreshToken(ctx context.Context, refreshToken string) error
- type OauthRepositoryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OauthRepository ¶
type OauthRepository struct {
// contains filtered or unexported fields
}
OauthRepository handles oauth2 database operations
func NewOauthRepository ¶
func NewOauthRepository(db *ent.Client) *OauthRepository
NewOauthRepository creates a new repository
func (*OauthRepository) CleanTokenStore ¶
func (self *OauthRepository) CleanTokenStore(ctx context.Context) (result error)
func (*OauthRepository) CreateAuthCode ¶
func (*OauthRepository) CreateToken ¶
func (*OauthRepository) DeleteAuthCode ¶
func (self *OauthRepository) DeleteAuthCode(ctx context.Context, code string) error
func (*OauthRepository) GetAuthCode ¶
func (self *OauthRepository) GetAuthCode(ctx context.Context, code string) (*ent.Oauth2Code, error)
func (*OauthRepository) GetByAccessToken ¶
func (self *OauthRepository) GetByAccessToken(ctx context.Context, accessToken string) (*ent.Oauth2Token, error)
func (*OauthRepository) GetByRefreshToken ¶
func (self *OauthRepository) GetByRefreshToken(ctx context.Context, refreshToken string) (*ent.Oauth2Token, error)
func (*OauthRepository) GetOrGenerateJWTPrivateKey ¶
func (self *OauthRepository) GetOrGenerateJWTPrivateKey(ctx context.Context) (*rsa.PrivateKey, []byte, error)
func (*OauthRepository) RevokeAccessToken ¶
func (self *OauthRepository) RevokeAccessToken(ctx context.Context, accessToken string) error
func (*OauthRepository) RevokeRefreshToken ¶
func (self *OauthRepository) RevokeRefreshToken(ctx context.Context, refreshToken string) error
type OauthRepositoryInterface ¶
type OauthRepositoryInterface interface {
GetOrGenerateJWTPrivateKey(ctx context.Context) (*rsa.PrivateKey, []byte, error)
CreateAuthCode(ctx context.Context, code, clientID, scope string, user *ent.User, expiresAt time.Time) (*ent.Oauth2Code, error)
DeleteAuthCode(ctx context.Context, code string) error
GetAuthCode(ctx context.Context, code string) (*ent.Oauth2Code, error)
CreateToken(ctx context.Context, accessToken, refreshToken, clientID, scope string, expiresAt time.Time, user *ent.User) (*ent.Oauth2Token, error)
RevokeAccessToken(ctx context.Context, accessToken string) error
RevokeRefreshToken(ctx context.Context, refreshToken string) error
GetByAccessToken(ctx context.Context, accessToken string) (*ent.Oauth2Token, error)
GetByRefreshToken(ctx context.Context, refreshToken string) (*ent.Oauth2Token, error)
CleanTokenStore(ctx context.Context) (result error)
}
OauthRepositoryInterface ...
Click to show internal directories.
Click to hide internal directories.