Documentation ¶
Index ¶
- type AuthService
- func (s *AuthService) GenerateAuthURL() string
- func (s *AuthService) GetTokens(ctx context.Context, code, state string, jwks json.RawMessage) (*model.TokenPair, error)
- func (s *AuthService) ParseAccessToken(signed string) (*model.NewellaJWTToken, error)
- func (s *AuthService) RefreshTokens(ctx context.Context, tokenPair model.TokenPair, jwks json.RawMessage) (*model.TokenPair, error)
- func (s *AuthService) RemoveTokens(ctx context.Context, userID string) error
- func (s *AuthService) VerifyState(state string) bool
- type AuthStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(logger logger.Logger, storage AuthStorage, cache *cache.Cache, oauthCfg *oauth2.Config, sgnKey string) *AuthService
func (*AuthService) GenerateAuthURL ¶
func (s *AuthService) GenerateAuthURL() string
func (*AuthService) GetTokens ¶
func (s *AuthService) GetTokens(ctx context.Context, code, state string, jwks json.RawMessage) (*model.TokenPair, error)
func (*AuthService) ParseAccessToken ¶
func (s *AuthService) ParseAccessToken(signed string) (*model.NewellaJWTToken, error)
func (*AuthService) RefreshTokens ¶
func (s *AuthService) RefreshTokens(ctx context.Context, tokenPair model.TokenPair, jwks json.RawMessage) (*model.TokenPair, error)
func (*AuthService) RemoveTokens ¶
func (s *AuthService) RemoveTokens(ctx context.Context, userID string) error
func (*AuthService) VerifyState ¶
func (s *AuthService) VerifyState(state string) bool
type AuthStorage ¶
type AuthStorage interface { SaveUser(ctx context.Context, oauthJWT model.OAuthJWTToken, pair model.TokenPair) (string, error) GetTokensPair(ctx context.Context, refreshToken, userID string) (*model.TokenPair, error) UpdateTokens(ctx context.Context, pair model.TokenPair, userID string) error RemoveTokens(ctx context.Context, userID string) error }
Click to show internal directories.
Click to hide internal directories.