Documentation
¶
Index ¶
- Constants
- type Arguments
- func (r Arguments) Exact(name string) booldeprecated
- func (r Arguments) ExactOne(name string) bool
- func (r Arguments) Has(items ...string) bool
- func (r Arguments) HasOneOf(items ...string) bool
- func (r Arguments) Matches(items ...string) bool
- func (r Arguments) MatchesExact(items ...string) bool
- func (r Arguments) String() string
- type AuthenticationRequestContextFactory
- type AuthenticationResponseWriter
- type Config
- type ErrorFactory
- type ErrorStrategy
- type IAccessTokenStrategy
- type IAuthEPHandler
- type IAuthenticationRequestContext
- type IAuthorizationCodeStrategy
- type IBaseContext
- type IClient
- type IClientStore
- type IConfigurable
- type IError
- type IIDTokenStrategy
- type IIntrospectionRequestContext
- type IManager
- type IRefreshTokenStrategy
- type IRequestContext
- type IRevocationRequestContext
- type ISession
- type ISessionManager
- type ITokenEPHandler
- type ITokenRequestContext
- type ITokenStore
- type ITransactionalStore
- type IUserStore
- type IntrospectionRequestContextFactory
- type IntrospectionResponseWriter
- type JsonErrorWriter
- type RedirectErrorWriter
- type RequestProfile
- func (r RequestProfile) GetAudience() Arguments
- func (r RequestProfile) GetClientID() string
- func (r RequestProfile) GetDomain() string
- func (r RequestProfile) GetNonce() string
- func (r RequestProfile) GetRedirectURI() string
- func (r RequestProfile) GetScope() Arguments
- func (r RequestProfile) GetState() string
- func (r RequestProfile) GetUsername() string
- func (r RequestProfile) IsClient() bool
- func (r RequestProfile) SetAudience(aud Arguments)
- func (r RequestProfile) SetClientID(username string)
- func (r RequestProfile) SetDomain(domain string)
- func (r RequestProfile) SetNonce(nonce string)
- func (r RequestProfile) SetRedirectURI(redirectUri string)
- func (r RequestProfile) SetScope(scopes Arguments)
- func (r RequestProfile) SetState(state string)
- func (r RequestProfile) SetUsername(username string)
- type RevocationRequestContextFactory
- type RevocationResponseWriter
- type TokenRequestContextFactory
- type TokenResponseWriter
- type TokenSignatures
- type Tokens
Constants ¶
View Source
const ( GrantAuthorizationCode = "authorization_code" GrantImplicit = "implicit" GrantResourceOwnerPassword = "password" GrantClientCredentials = "client_credentials" GrantRefreshToken = "refresh_token" )
View Source
const ( ScopeOpenid = "openid" ScopeProfile = "profile" ScopeEmail = "email" ScopeAddress = "address" ScopeOfflineAccess = "offline_access" )
View Source
const ( ResponseTypeCode = "code" ResponseTypeToken = "token" ResponseTypeIdToken = "id_token" )
View Source
const ( ResponseModeQuery = "query" ResponseModeFragment = "fragment" ResponseModeFormPost = "form" )
View Source
const ( ContentTypeUrlEncodedForm = "application/x-www-form-urlencoded" ContentTypeJson = "application/json" ContentTypeHtml = "text/html" )
View Source
const ( HeaderContentType = "Content-Type" HeaderAuthorization = "Authorization" )
View Source
const ( ExpireAuthorizationCode = 1 ExpireAccessToken = 2 ExpireRefreshToken = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments []string
func (Arguments) ExactOne ¶
ExactOne checks, by string case, that a single argument equals the provided string.
func (Arguments) Has ¶
Has checks, in a case-insensitive manner, that all of the items provided exists in arguments.
func (Arguments) HasOneOf ¶
HasOneOf checks, in a case-insensitive manner, that one of the items provided exists in arguments.
func (Arguments) Matches ¶
Matches performs an case-insensitive, out-of-order check that the items provided exist and equal all of the args in arguments. Note:
- Providing a list that includes duplicate string-case items will return not matched.
func (Arguments) MatchesExact ¶
MatchesExact checks, by order and string case, that the items provided equal those in arguments.
type AuthenticationRequestContextFactory ¶
type AuthenticationRequestContextFactory func(request *http.Request) (IAuthenticationRequestContext, IError)
type AuthenticationResponseWriter ¶
type AuthenticationResponseWriter func(requestContext IAuthenticationRequestContext, w http.ResponseWriter, r *http.Request) error
type Config ¶
type ErrorStrategy ¶
type ErrorStrategy func(err error, w http.ResponseWriter)
type IAccessTokenStrategy ¶
type IAuthEPHandler ¶
type IAuthEPHandler interface {
HandleAuthEP(ctx context.Context, requestContext IAuthenticationRequestContext) IError
}
type IBaseContext ¶
type IClientStore ¶
type IConfigurable ¶
type IConfigurable interface {
Configure(strategy interface{}, config *Config, arg ...interface{})
}
type IIDTokenStrategy ¶
type IIntrospectionRequestContext ¶
type IIntrospectionRequestContext interface {
IBaseContext
GetProfile() RequestProfile
SetProfile(profile RequestProfile)
GetToken() string
GetTokenTypeHint() string
}
type IManager ¶
type IManager interface {
ProcessAuthorizationEP(w http.ResponseWriter, r *http.Request)
ProcessTokenEP(w http.ResponseWriter, r *http.Request)
ProcessIntrospectionEP(w http.ResponseWriter, r *http.Request)
ProcessRevocationEP(w http.ResponseWriter, r *http.Request)
}
type IRefreshTokenStrategy ¶
type IRequestContext ¶
type IRequestContext interface {
GetRequestID() string
GetRequestedAt() time.Time
GetState() string
GetRedirectURI() string
GetClientID() string
GetRequestedScopes() Arguments
GetRequestedAudience() Arguments
GetClaims() map[string]interface{}
GetClient() IClient
SetClient(client IClient)
GetProfile() RequestProfile
SetProfile(profile RequestProfile)
GetIssuedTokens() Tokens
IssueAccessToken(token string, signature string, expiry time.Time)
IssueRefreshToken(token string, signature string, expiry time.Time)
IssueIDToken(token string)
GetError() IError
SetError(err IError)
GetForm() *url.Values
}
type IRevocationRequestContext ¶
type IRevocationRequestContext interface {
IBaseContext
GetToken() string
GetTokenTypeHint() string
}
type ISessionManager ¶
type ITokenEPHandler ¶
type ITokenEPHandler interface {
HandleTokenEP(ctx context.Context, requestContext ITokenRequestContext) IError
}
type ITokenRequestContext ¶
type ITokenStore ¶
type ITokenStore interface {
StoreTokenProfile(ctx context.Context, reqId string, signatures TokenSignatures, profile RequestProfile) (err error)
GetProfileWithAuthCodeSign(ctx context.Context, signature string) (profile RequestProfile, reqId string, err error)
GetProfileWithAccessTokenSign(ctx context.Context, signature string) (profile RequestProfile, reqId string, err error)
GetProfileWithRefreshTokenSign(ctx context.Context, signature string) (profile RequestProfile, reqId string, err error)
InvalidateWithRequestID(ctx context.Context, reqID string, what uint8) (err error)
}
type ITransactionalStore ¶
type IUserStore ¶
type IUserStore interface {
Authenticate(ctx context.Context, username string, credential []byte) (err error)
GetClaims(ctx context.Context, username string, scopes Arguments, claimsIDs []string) (map[string]interface{}, error)
IsConsentRequired(ctx context.Context, username string, clientId string, scopes Arguments) bool
StoreConsent(ctx context.Context, username string, clientId string, scopes Arguments) error
FetchUserProfile(ctx context.Context, username string) RequestProfile
}
type IntrospectionRequestContextFactory ¶
type IntrospectionRequestContextFactory func(r *http.Request) (IRevocationRequestContext, IError)
type IntrospectionResponseWriter ¶
type IntrospectionResponseWriter func(requestContext IRevocationRequestContext, w http.ResponseWriter, r *http.Request) error
type JsonErrorWriter ¶
type JsonErrorWriter func(requestContext ITokenRequestContext, w http.ResponseWriter, r *http.Request) error
type RedirectErrorWriter ¶
type RedirectErrorWriter func(requestContext IAuthenticationRequestContext, w http.ResponseWriter, r *http.Request) error
type RequestProfile ¶
func NewRequestProfile ¶
func NewRequestProfile() RequestProfile
func (RequestProfile) GetAudience ¶
func (r RequestProfile) GetAudience() Arguments
func (RequestProfile) GetClientID ¶
func (r RequestProfile) GetClientID() string
func (RequestProfile) GetDomain ¶
func (r RequestProfile) GetDomain() string
func (RequestProfile) GetNonce ¶
func (r RequestProfile) GetNonce() string
func (RequestProfile) GetRedirectURI ¶
func (r RequestProfile) GetRedirectURI() string
func (RequestProfile) GetScope ¶
func (r RequestProfile) GetScope() Arguments
func (RequestProfile) GetState ¶
func (r RequestProfile) GetState() string
func (RequestProfile) GetUsername ¶
func (r RequestProfile) GetUsername() string
func (RequestProfile) IsClient ¶
func (r RequestProfile) IsClient() bool
func (RequestProfile) SetAudience ¶
func (r RequestProfile) SetAudience(aud Arguments)
func (RequestProfile) SetClientID ¶
func (r RequestProfile) SetClientID(username string)
func (RequestProfile) SetDomain ¶
func (r RequestProfile) SetDomain(domain string)
func (RequestProfile) SetNonce ¶
func (r RequestProfile) SetNonce(nonce string)
func (RequestProfile) SetRedirectURI ¶
func (r RequestProfile) SetRedirectURI(redirectUri string)
func (RequestProfile) SetScope ¶
func (r RequestProfile) SetScope(scopes Arguments)
func (RequestProfile) SetState ¶
func (r RequestProfile) SetState(state string)
func (RequestProfile) SetUsername ¶
func (r RequestProfile) SetUsername(username string)
type RevocationRequestContextFactory ¶
type RevocationRequestContextFactory func(r *http.Request) (IRevocationRequestContext, IError)
type RevocationResponseWriter ¶
type RevocationResponseWriter func(requestContext IRevocationRequestContext, w http.ResponseWriter, r *http.Request) error
type TokenRequestContextFactory ¶
type TokenRequestContextFactory func(request *http.Request) (ITokenRequestContext, IError)
type TokenResponseWriter ¶
type TokenResponseWriter func(requestContext ITokenRequestContext, w http.ResponseWriter, r *http.Request) error
type TokenSignatures ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.