Documentation
¶
Index ¶
- type AuthenticationVerifierStore
- type AuthorizationCodeTokenRequest
- type AuthorizationError
- type AuthorizationGrant
- type AuthorizationRequest
- type AuthorizationResponse
- type AuthorizationService
- type AuthorizationStore
- type Client
- type ClientDTO
- type ClientModel
- type ClientRepository
- type ClientService
- func (s *ClientService) Create(ctx context.Context, dto ClientDTO) (*Client, error)
- func (s *ClientService) Delete(ctx context.Context, id string) error
- func (s *ClientService) FindById(ctx context.Context, id string) (*Client, error)
- func (s *ClientService) List(ctx context.Context) ([]*Client, error)
- func (s *ClientService) Update(ctx context.Context, dto ClientDTO) (*Client, error)
- type ClientWithSecretDTO
- type CodeStore
- type OAuthTokenService
- type RandomTokenHandler
- type RefreshTokenRequest
- type ResponseUriBuilder
- type TokenError
- type TokenHandler
- type TokenRequest
- type TokenResponse
- type TokenStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationVerifierStore ¶
type AuthenticationVerifierStore = core.KeyValueStore[string, []byte]
type AuthorizationCodeTokenRequest ¶
type AuthorizationCodeTokenRequest struct { RedirectUri string `form:"redirect_uri"` Code string `form:"code" binding:"required"` CodeVerifier string `form:"code_verifier"` // contains filtered or unexported fields }
func (*AuthorizationCodeTokenRequest) GetGrantType ¶
func (r *AuthorizationCodeTokenRequest) GetGrantType() string
type AuthorizationError ¶
type AuthorizationError struct { RedirectUri string State string Issuer string ErrorType string Description string }
func (*AuthorizationError) BuildResponseURI ¶
func (e *AuthorizationError) BuildResponseURI() string
func (*AuthorizationError) Error ¶
func (e *AuthorizationError) Error() string
type AuthorizationGrant ¶
type AuthorizationRequest ¶
type AuthorizationResponse ¶
func (*AuthorizationResponse) BuildResponseURI ¶
func (r *AuthorizationResponse) BuildResponseURI() string
type AuthorizationService ¶
type AuthorizationService struct {
// contains filtered or unexported fields
}
func NewAuthorizationService ¶
func NewAuthorizationService(authorizationStore AuthorizationStore, codeStore CodeStore, authenticationVerifierStore AuthenticationVerifierStore, clientService *ClientService, authorizationCodeInit metric.Int64Counter, authorizationCodeSuccess metric.Int64Counter) *AuthorizationService
func (*AuthorizationService) Authorize ¶
func (s *AuthorizationService) Authorize(ctx context.Context, request *AuthorizationRequest) (string, *AuthorizationError)
func (*AuthorizationService) VerifyAuthentication ¶
func (s *AuthorizationService) VerifyAuthentication(ctx context.Context, uuid string, authenticationVerifier string) ResponseUriBuilder
type AuthorizationStore ¶
type AuthorizationStore = core.KeyValueStore[string, *AuthorizationRequest]
type Client ¶
func (*Client) RestrictScopes ¶
type ClientModel ¶
type ClientRepository ¶
type ClientRepository = core.Repository[string, *ClientModel]
type ClientService ¶
type ClientService struct {
// contains filtered or unexported fields
}
func NewClientService ¶
func NewClientService(repo ClientRepository) *ClientService
type ClientWithSecretDTO ¶
type CodeStore ¶
type CodeStore = core.KeyValueStore[string, *AuthorizationRequest]
type OAuthTokenService ¶
type OAuthTokenService struct {
// contains filtered or unexported fields
}
func NewOAuthTokenService ¶
func NewOAuthTokenService(codeStore CodeStore, accessTokenHandler TokenHandler, refreshTokenHandler TokenHandler, tokenRequestInstrument metric.Int64Counter) *OAuthTokenService
func (*OAuthTokenService) Token ¶
func (s *OAuthTokenService) Token(ctx context.Context, request TokenRequest) (*TokenResponse, *TokenError)
func (*OAuthTokenService) Validate ¶
func (s *OAuthTokenService) Validate(ctx context.Context, token string) (*AuthorizationGrant, error)
type RandomTokenHandler ¶
type RandomTokenHandler struct {
// contains filtered or unexported fields
}
func NewRandomTokenHandler ¶
func NewRandomTokenHandler(tokenType string, tokenSize int, store TokenStore, tokensGenerated metric.Int64Counter) *RandomTokenHandler
func (*RandomTokenHandler) GenerateToken ¶
func (h *RandomTokenHandler) GenerateToken(ctx context.Context, grant *AuthorizationGrant) (string, error)
func (*RandomTokenHandler) Validate ¶
func (h *RandomTokenHandler) Validate(ctx context.Context, token string) (*AuthorizationGrant, error)
type RefreshTokenRequest ¶
type RefreshTokenRequest struct { RefreshToken string `form:"refresh_token" binding:"required"` // contains filtered or unexported fields }
func (*RefreshTokenRequest) GetGrantType ¶
func (r *RefreshTokenRequest) GetGrantType() string
type ResponseUriBuilder ¶
type ResponseUriBuilder interface {
BuildResponseURI() string
}
type TokenError ¶
type TokenError struct { ErrorType string `json:"error" binding:"required"` ErrorDescription string `json:"error_description" binding:"required"` }
func (*TokenError) Error ¶
func (e *TokenError) Error() string
type TokenHandler ¶
type TokenHandler interface { GenerateToken(ctx context.Context, grant *AuthorizationGrant) (string, error) Validate(ctx context.Context, token string) (*AuthorizationGrant, error) }
type TokenRequest ¶
type TokenRequest interface {
GetGrantType() string
}
type TokenResponse ¶
type TokenStore ¶
type TokenStore = core.KeyValueStore[string, *AuthorizationGrant]
Click to show internal directories.
Click to hide internal directories.