Documentation ¶
Index ¶
- type AccessTokenStorage
- type AccessTokenStrategy
- type AuthorizeCodeGrantStorage
- type AuthorizeCodeStorage
- type AuthorizeCodeStrategy
- type AuthorizeExplicitGrantHandler
- func (c *AuthorizeExplicitGrantHandler) HandleAuthorizeEndpointRequest(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, ...) error
- func (c *AuthorizeExplicitGrantHandler) HandleTokenEndpointRequest(ctx context.Context, r *http.Request, request fosite.AccessRequester) error
- func (c *AuthorizeExplicitGrantHandler) IssueAuthorizeCode(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, ...) error
- func (c *AuthorizeExplicitGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, req *http.Request, requester fosite.AccessRequester, ...) error
- type AuthorizeImplicitGrantTypeHandler
- func (c *AuthorizeImplicitGrantTypeHandler) HandleAuthorizeEndpointRequest(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, ...) error
- func (c *AuthorizeImplicitGrantTypeHandler) IssueImplicitAccessToken(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, ...) error
- type ClientCredentialsGrantHandler
- type ClientCredentialsGrantStorage
- type CoreStorage
- type CoreStrategy
- type CoreValidator
- type HMACSHAStrategy
- func (h HMACSHAStrategy) AccessTokenSignature(token string) string
- func (h HMACSHAStrategy) AuthorizeCodeSignature(token string) string
- func (h HMACSHAStrategy) GenerateAccessToken(_ context.Context, _ fosite.Requester) (token string, signature string, err error)
- func (h HMACSHAStrategy) GenerateAuthorizeCode(_ context.Context, _ fosite.Requester) (token string, signature string, err error)
- func (h HMACSHAStrategy) GenerateRefreshToken(_ context.Context, _ fosite.Requester) (token string, signature string, err error)
- func (h HMACSHAStrategy) RefreshTokenSignature(token string) string
- func (h HMACSHAStrategy) ValidateAccessToken(_ context.Context, r fosite.Requester, token string) (err error)
- func (h HMACSHAStrategy) ValidateAuthorizeCode(_ context.Context, r fosite.Requester, token string) (err error)
- func (h HMACSHAStrategy) ValidateRefreshToken(_ context.Context, _ fosite.Requester, token string) (err error)
- type HMACSession
- type HMACSessionContainer
- type HandleHelper
- type ImplicitGrantStorage
- type JWTSession
- type JWTSessionContainer
- type RS256JWTStrategy
- func (h RS256JWTStrategy) AccessTokenSignature(token string) string
- func (h RS256JWTStrategy) AuthorizeCodeSignature(token string) string
- func (h *RS256JWTStrategy) GenerateAccessToken(_ context.Context, requester fosite.Requester) (token string, signature string, err error)
- func (h *RS256JWTStrategy) GenerateAuthorizeCode(_ context.Context, requester fosite.Requester) (token string, signature string, err error)
- func (h *RS256JWTStrategy) GenerateRefreshToken(_ context.Context, requester fosite.Requester) (token string, signature string, err error)
- func (h RS256JWTStrategy) RefreshTokenSignature(token string) string
- func (h *RS256JWTStrategy) ValidateAccessToken(_ context.Context, _ fosite.Requester, token string) error
- func (h *RS256JWTStrategy) ValidateAuthorizeCode(_ context.Context, requester fosite.Requester, token string) error
- func (h *RS256JWTStrategy) ValidateRefreshToken(_ context.Context, _ fosite.Requester, token string) error
- type RefreshTokenGrantHandler
- type RefreshTokenGrantStorage
- type RefreshTokenStorage
- type RefreshTokenStrategy
- type ResourceOwnerPasswordCredentialsGrantHandler
- func (c *ResourceOwnerPasswordCredentialsGrantHandler) HandleTokenEndpointRequest(ctx context.Context, req *http.Request, request fosite.AccessRequester) error
- func (c *ResourceOwnerPasswordCredentialsGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, req *http.Request, requester fosite.AccessRequester, ...) error
- type ResourceOwnerPasswordCredentialsGrantStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenStorage ¶
type AccessTokenStorage interface { CreateAccessTokenSession(ctx context.Context, signature string, request fosite.Requester) (err error) GetAccessTokenSession(ctx context.Context, signature string, session interface{}) (request fosite.Requester, err error) DeleteAccessTokenSession(ctx context.Context, signature string) (err error) }
type AccessTokenStrategy ¶
type AuthorizeCodeStorage ¶
type AuthorizeCodeStorage interface { CreateAuthorizeCodeSession(ctx context.Context, code string, request fosite.Requester) (err error) GetAuthorizeCodeSession(ctx context.Context, code string, session interface{}) (request fosite.Requester, err error) DeleteAuthorizeCodeSession(ctx context.Context, code string) (err error) }
type AuthorizeCodeStrategy ¶
type AuthorizeExplicitGrantHandler ¶
type AuthorizeExplicitGrantHandler struct { AccessTokenStrategy AccessTokenStrategy RefreshTokenStrategy RefreshTokenStrategy AuthorizeCodeStrategy AuthorizeCodeStrategy // AuthorizeCodeGrantStorage is used to persist session data across requests. AuthorizeCodeGrantStorage AuthorizeCodeGrantStorage // AuthCodeLifespan defines the lifetime of an authorize code. AuthCodeLifespan time.Duration // AccessTokenLifespan defines the lifetime of an access token. AccessTokenLifespan time.Duration ScopeStrategy fosite.ScopeStrategy }
AuthorizeExplicitGrantTypeHandler is a response handler for the Authorize Code grant using the explicit grant type as defined in https://tools.ietf.org/html/rfc6749#section-4.1
func (*AuthorizeExplicitGrantHandler) HandleAuthorizeEndpointRequest ¶
func (c *AuthorizeExplicitGrantHandler) HandleAuthorizeEndpointRequest(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error
func (*AuthorizeExplicitGrantHandler) HandleTokenEndpointRequest ¶
func (c *AuthorizeExplicitGrantHandler) HandleTokenEndpointRequest(ctx context.Context, r *http.Request, request fosite.AccessRequester) error
HandleTokenEndpointRequest implements * https://tools.ietf.org/html/rfc6749#section-4.1.3 (everything)
func (*AuthorizeExplicitGrantHandler) IssueAuthorizeCode ¶
func (c *AuthorizeExplicitGrantHandler) IssueAuthorizeCode(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error
func (*AuthorizeExplicitGrantHandler) PopulateTokenEndpointResponse ¶
func (c *AuthorizeExplicitGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, req *http.Request, requester fosite.AccessRequester, responder fosite.AccessResponder) error
type AuthorizeImplicitGrantTypeHandler ¶
type AuthorizeImplicitGrantTypeHandler struct { AccessTokenStrategy AccessTokenStrategy // ImplicitGrantStorage is used to persist session data across requests. AccessTokenStorage AccessTokenStorage // AccessTokenLifespan defines the lifetime of an access token. AccessTokenLifespan time.Duration ScopeStrategy fosite.ScopeStrategy }
AuthorizeImplicitGrantTypeHandler is a response handler for the Authorize Code grant using the implicit grant type as defined in https://tools.ietf.org/html/rfc6749#section-4.2
func (*AuthorizeImplicitGrantTypeHandler) HandleAuthorizeEndpointRequest ¶
func (c *AuthorizeImplicitGrantTypeHandler) HandleAuthorizeEndpointRequest(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error
func (*AuthorizeImplicitGrantTypeHandler) IssueImplicitAccessToken ¶
func (c *AuthorizeImplicitGrantTypeHandler) IssueImplicitAccessToken(ctx context.Context, req *http.Request, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error
type ClientCredentialsGrantHandler ¶
type ClientCredentialsGrantHandler struct { *HandleHelper ScopeStrategy fosite.ScopeStrategy }
func (*ClientCredentialsGrantHandler) HandleTokenEndpointRequest ¶
func (c *ClientCredentialsGrantHandler) HandleTokenEndpointRequest(_ context.Context, r *http.Request, request fosite.AccessRequester) error
ValidateTokenEndpointRequest implements https://tools.ietf.org/html/rfc6749#section-4.4.2
func (*ClientCredentialsGrantHandler) PopulateTokenEndpointResponse ¶
func (c *ClientCredentialsGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, r *http.Request, request fosite.AccessRequester, response fosite.AccessResponder) error
PopulateTokenEndpointResponse implements https://tools.ietf.org/html/rfc6749#section-4.4.3
type ClientCredentialsGrantStorage ¶
type ClientCredentialsGrantStorage interface { AccessTokenStorage }
type CoreStorage ¶
type CoreStorage interface { AuthorizeCodeStorage AccessTokenStorage RefreshTokenStorage }
type CoreStrategy ¶
type CoreStrategy interface { AccessTokenStrategy RefreshTokenStrategy AuthorizeCodeStrategy }
type CoreValidator ¶
type CoreValidator struct { CoreStrategy CoreStorage ScopeStrategy fosite.ScopeStrategy }
func (*CoreValidator) ValidateToken ¶
func (c *CoreValidator) ValidateToken(ctx context.Context, token string, tokenType fosite.TokenType, accessRequest fosite.AccessRequester, scopes []string) error
type HMACSHAStrategy ¶
type HMACSHAStrategy struct { Enigma *enigma.HMACStrategy AccessTokenLifespan time.Duration AuthorizeCodeLifespan time.Duration }
func (HMACSHAStrategy) AccessTokenSignature ¶
func (h HMACSHAStrategy) AccessTokenSignature(token string) string
func (HMACSHAStrategy) AuthorizeCodeSignature ¶
func (h HMACSHAStrategy) AuthorizeCodeSignature(token string) string
func (HMACSHAStrategy) GenerateAccessToken ¶
func (HMACSHAStrategy) GenerateAuthorizeCode ¶
func (HMACSHAStrategy) GenerateRefreshToken ¶
func (HMACSHAStrategy) RefreshTokenSignature ¶
func (h HMACSHAStrategy) RefreshTokenSignature(token string) string
func (HMACSHAStrategy) ValidateAccessToken ¶
func (HMACSHAStrategy) ValidateAuthorizeCode ¶
func (HMACSHAStrategy) ValidateRefreshToken ¶
type HMACSession ¶
HMACSession Container for the HMAC session.
func (*HMACSession) AccessTokenExpiresAt ¶
func (s *HMACSession) AccessTokenExpiresAt(fallback time.Time) time.Time
func (*HMACSession) AuthorizeCodeExpiresAt ¶
func (s *HMACSession) AuthorizeCodeExpiresAt(fallback time.Time) time.Time
type HMACSessionContainer ¶
type HandleHelper ¶
type HandleHelper struct { AccessTokenStrategy AccessTokenStrategy AccessTokenStorage AccessTokenStorage AccessTokenLifespan time.Duration }
func (*HandleHelper) IssueAccessToken ¶
func (h *HandleHelper) IssueAccessToken(ctx context.Context, req *http.Request, requester fosite.AccessRequester, responder fosite.AccessResponder) error
type ImplicitGrantStorage ¶
type JWTSession ¶
JWTSession Container for the JWT session.
func (*JWTSession) GetJWTClaims ¶
func (j *JWTSession) GetJWTClaims() *jwt.JWTClaims
func (*JWTSession) GetJWTHeader ¶
func (j *JWTSession) GetJWTHeader() *jwt.Headers
type JWTSessionContainer ¶
type RS256JWTStrategy ¶
type RS256JWTStrategy struct {
*jwt.RS256JWTStrategy
}
RS256JWTStrategy is a JWT RS256 strategy.
func (RS256JWTStrategy) AccessTokenSignature ¶
func (h RS256JWTStrategy) AccessTokenSignature(token string) string
func (RS256JWTStrategy) AuthorizeCodeSignature ¶
func (h RS256JWTStrategy) AuthorizeCodeSignature(token string) string
func (*RS256JWTStrategy) GenerateAccessToken ¶
func (*RS256JWTStrategy) GenerateAuthorizeCode ¶
func (*RS256JWTStrategy) GenerateRefreshToken ¶
func (RS256JWTStrategy) RefreshTokenSignature ¶
func (h RS256JWTStrategy) RefreshTokenSignature(token string) string
func (*RS256JWTStrategy) ValidateAccessToken ¶
func (*RS256JWTStrategy) ValidateAuthorizeCode ¶
func (*RS256JWTStrategy) ValidateRefreshToken ¶
type RefreshTokenGrantHandler ¶
type RefreshTokenGrantHandler struct { AccessTokenStrategy AccessTokenStrategy RefreshTokenStrategy RefreshTokenStrategy // RefreshTokenGrantStorage is used to persist session data across requests. RefreshTokenGrantStorage RefreshTokenGrantStorage // AccessTokenLifespan defines the lifetime of an access token. AccessTokenLifespan time.Duration }
func (*RefreshTokenGrantHandler) HandleTokenEndpointRequest ¶
func (c *RefreshTokenGrantHandler) HandleTokenEndpointRequest(ctx context.Context, req *http.Request, request fosite.AccessRequester) error
HandleTokenEndpointRequest implements https://tools.ietf.org/html/rfc6749#section-6
func (*RefreshTokenGrantHandler) PopulateTokenEndpointResponse ¶
func (c *RefreshTokenGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, req *http.Request, requester fosite.AccessRequester, responder fosite.AccessResponder) error
PopulateTokenEndpointResponse implements https://tools.ietf.org/html/rfc6749#section-6
type RefreshTokenStorage ¶
type RefreshTokenStorage interface { CreateRefreshTokenSession(ctx context.Context, signature string, request fosite.Requester) (err error) GetRefreshTokenSession(ctx context.Context, signature string, session interface{}) (request fosite.Requester, err error) DeleteRefreshTokenSession(ctx context.Context, signature string) (err error) }
type RefreshTokenStrategy ¶
type ResourceOwnerPasswordCredentialsGrantHandler ¶
type ResourceOwnerPasswordCredentialsGrantHandler struct { // ResourceOwnerPasswordCredentialsGrantStorage is used to persist session data across requests. ResourceOwnerPasswordCredentialsGrantStorage ResourceOwnerPasswordCredentialsGrantStorage RefreshTokenStrategy RefreshTokenStrategy ScopeStrategy fosite.ScopeStrategy *HandleHelper }
func (*ResourceOwnerPasswordCredentialsGrantHandler) HandleTokenEndpointRequest ¶
func (c *ResourceOwnerPasswordCredentialsGrantHandler) HandleTokenEndpointRequest(ctx context.Context, req *http.Request, request fosite.AccessRequester) error
HandleTokenEndpointRequest implements https://tools.ietf.org/html/rfc6749#section-4.3.2
func (*ResourceOwnerPasswordCredentialsGrantHandler) PopulateTokenEndpointResponse ¶
func (c *ResourceOwnerPasswordCredentialsGrantHandler) PopulateTokenEndpointResponse(ctx context.Context, req *http.Request, requester fosite.AccessRequester, responder fosite.AccessResponder) error
PopulateTokenEndpointResponse implements https://tools.ietf.org/html/rfc6749#section-4.3.3
type ResourceOwnerPasswordCredentialsGrantStorage ¶
type ResourceOwnerPasswordCredentialsGrantStorage interface { Authenticate(ctx context.Context, name string, secret string) error AccessTokenStorage RefreshTokenStorage }
Source Files ¶
- flow_authorize_code_auth.go
- flow_authorize_code_storage.go
- flow_authorize_code_token.go
- flow_authorize_implicit.go
- flow_authorize_implicit_storage.go
- flow_client.go
- flow_client_credentials_storage.go
- flow_refresh.go
- flow_refresh_storage.go
- flow_resource_owner.go
- flow_resource_owner_storage.go
- helper.go
- storage.go
- strategy.go
- strategy_hmacsha.go
- strategy_hmacsha_session.go
- strategy_jwt.go
- strategy_jwt_session.go
- validator.go