Documentation ¶
Index ¶
- Variables
- func ConfigureAppSessionTokenRoute(route httproute.Route) httproute.Route
- func ConfigureAuthorizeRoute(route httproute.Route) httproute.Route
- func ConfigureChallengeRoute(route httproute.Route) httproute.Route
- func ConfigureConsentRoute(route httproute.Route) httproute.Route
- func ConfigureEndSessionRoute(route httproute.Route) httproute.Route
- func ConfigureJWKSRoute(route httproute.Route) httproute.Route
- func ConfigureOAuthMetadataRoute(route httproute.Route) httproute.Route
- func ConfigureOIDCMetadataRoute(route httproute.Route) httproute.Route
- func ConfigureProxyRedirectRoute(route httproute.Route) httproute.Route
- func ConfigureRevokeRoute(route httproute.Route) httproute.Route
- func ConfigureTokenRoute(route httproute.Route) httproute.Route
- func ConfigureUserInfoRoute(route httproute.Route) httproute.Route
- type AppSessionTokenHandler
- type AppSessionTokenIssuer
- type AppSessionTokenRequest
- type AppSessionTokenResponse
- type AuthorizeHandler
- type AuthorizeHandlerLogger
- type ChallengeHandler
- type ChallengeProvider
- type ChallengeRequest
- type ChallengeResponse
- type ConsentHandler
- type ConsentHandlerLogger
- type ConsentUserService
- type ConsentViewModel
- type EndSessionHandler
- type EndSessionHandlerLogger
- type JSONResponseWriter
- type JWKSHandler
- type JWKSHandlerLogger
- type JWSSource
- type MetadataHandler
- type MetadataProvider
- type OAuthClientResolver
- type ProtocolAuthorizeHandler
- type ProtocolConsentHandler
- type ProtocolEndSessionHandler
- type ProtocolIdentityService
- type ProtocolProxyRedirectHandler
- type ProtocolRevokeHandler
- type ProtocolTokenHandler
- type ProtocolUserInfoProvider
- type ProxyRedirectHandler
- type Renderer
- type RevokeHandler
- type RevokeHandlerLogger
- type TokenHandler
- type TokenHandlerLogger
- type UserInfoHandler
- type UserInfoHandlerLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var AppSessionTokenAPIRequestSchema = validation.NewSimpleSchema(`
{
"type": "object",
"additionalProperties": false,
"properties": {
"refresh_token": { "type": "string" }
},
"required": ["refresh_token"]
}
`)
View Source
var AppSessionTokenAPIResponseSchema = validation.NewSimpleSchema(`
{
"type": "object",
"properties": {
"app_session_token": { "type": "string" },
"expire_at": { "type": "string" }
},
"required": ["app_session_token", "expire_at"]
}
`)
View Source
var ChallengeAPIRequestSchema = validation.NewSimpleSchema(`
{
"type": "object",
"additionalProperties": false,
"properties": {
"purpose": { "type": "string" }
},
"required": ["purpose"]
}
`)
View Source
var ChallengeAPIResponseSchema = validation.NewSimpleSchema(`
{
"type": "object",
"properties": {
"token": { "type": "string" },
"expire_at": { "type": "string" }
},
"required": ["token", "expire_at"]
}
`)
View Source
var DependencySet = wire.NewSet( NewAuthorizeHandlerLogger, wire.Struct(new(AuthorizeHandler), "*"), NewConsentHandlerLogger, wire.Struct(new(ConsentHandler), "*"), NewTokenHandlerLogger, wire.Struct(new(TokenHandler), "*"), NewRevokeHandlerLogger, wire.Struct(new(RevokeHandler), "*"), wire.Struct(new(MetadataHandler), "*"), NewJWKSHandlerLogger, wire.Struct(new(JWKSHandler), "*"), NewUserInfoHandlerLogger, wire.Struct(new(UserInfoHandler), "*"), NewEndSessionHandlerLogger, wire.Struct(new(EndSessionHandler), "*"), wire.Struct(new(ChallengeHandler), "*"), wire.Struct(new(AppSessionTokenHandler), "*"), wire.Struct(new(ProxyRedirectHandler), "*"), )
View Source
var InvalidGrant = apierrors.Forbidden.WithReason("InvalidGrant")
Functions ¶
Types ¶
type AppSessionTokenHandler ¶
type AppSessionTokenHandler struct { Database *appdb.Handle JSON JSONResponseWriter AppSessionTokens AppSessionTokenIssuer }
func (*AppSessionTokenHandler) Handle ¶
func (h *AppSessionTokenHandler) Handle(ctx context.Context, resp http.ResponseWriter, req *http.Request) (*AppSessionTokenResponse, error)
func (*AppSessionTokenHandler) ServeHTTP ¶
func (h *AppSessionTokenHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
type AppSessionTokenIssuer ¶
type AppSessionTokenRequest ¶
type AppSessionTokenRequest struct {
RefreshToken string `json:"refresh_token"`
}
type AppSessionTokenResponse ¶
type AuthorizeHandler ¶
type AuthorizeHandler struct { Logger AuthorizeHandlerLogger Database *appdb.Handle AuthzHandler ProtocolAuthorizeHandler }
func (*AuthorizeHandler) ServeHTTP ¶
func (h *AuthorizeHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type AuthorizeHandlerLogger ¶
func NewAuthorizeHandlerLogger ¶
func NewAuthorizeHandlerLogger(lf *log.Factory) AuthorizeHandlerLogger
type ChallengeHandler ¶
type ChallengeHandler struct { Database *appdb.Handle Challenges ChallengeProvider JSON JSONResponseWriter }
@Operation POST /challenge - Obtain new challenge
Obtain a new challenge for challenge-based OAuth authentication. Challenges can be used once only. @Tag User @RequestBody Describe purpose of the challenge. @JSONSchema {OAuthChallengeRequest} @Response 200 Created challenge information. @JSONSchema {OAuthChallengeResponse}
func (*ChallengeHandler) Handle ¶
func (h *ChallengeHandler) Handle(ctx context.Context, resp http.ResponseWriter, req *http.Request) (*ChallengeResponse, error)
func (*ChallengeHandler) ServeHTTP ¶
func (h *ChallengeHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
type ChallengeProvider ¶
type ChallengeRequest ¶
func (*ChallengeRequest) Validate ¶
func (p *ChallengeRequest) Validate(ctx *validation.Context)
type ChallengeResponse ¶
type ConsentHandler ¶
type ConsentHandler struct { Logger ConsentHandlerLogger Database *appdb.Handle Handler ProtocolConsentHandler BaseViewModel *viewmodels.BaseViewModeler Renderer Renderer Identities ProtocolIdentityService Users ConsentUserService }
func (*ConsentHandler) ServeHTTP ¶
func (h *ConsentHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type ConsentHandlerLogger ¶
func NewConsentHandlerLogger ¶
func NewConsentHandlerLogger(lf *log.Factory) ConsentHandlerLogger
type ConsentUserService ¶
type ConsentViewModel ¶
type EndSessionHandler ¶
type EndSessionHandler struct { Logger EndSessionHandlerLogger Database *appdb.Handle EndSessionHandler ProtocolEndSessionHandler }
func (*EndSessionHandler) ServeHTTP ¶
func (h *EndSessionHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type EndSessionHandlerLogger ¶
func NewEndSessionHandlerLogger ¶
func NewEndSessionHandlerLogger(lf *log.Factory) EndSessionHandlerLogger
type JSONResponseWriter ¶
type JSONResponseWriter interface {
WriteResponse(rw http.ResponseWriter, resp *api.Response)
}
type JWKSHandler ¶
type JWKSHandler struct { Logger JWKSHandlerLogger JWKS JWSSource }
func (*JWKSHandler) ServeHTTP ¶
func (h *JWKSHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type JWKSHandlerLogger ¶
func NewJWKSHandlerLogger ¶
func NewJWKSHandlerLogger(lf *log.Factory) JWKSHandlerLogger
type MetadataHandler ¶
type MetadataHandler struct {
Providers []MetadataProvider
}
func (*MetadataHandler) ServeHTTP ¶
func (h *MetadataHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type MetadataProvider ¶
type MetadataProvider interface {
PopulateMetadata(meta map[string]interface{})
}
type OAuthClientResolver ¶
type OAuthClientResolver interface {
ResolveClient(clientID string) *config.OAuthClientConfig
}
type ProtocolConsentHandler ¶
type ProtocolConsentHandler interface { HandleConsentWithoutUserConsent(ctx context.Context, req *http.Request) (httputil.Result, *oauthhandler.ConsentRequired) HandleConsentWithUserConsent(ctx context.Context, req *http.Request) httputil.Result HandleConsentWithUserCancel(ctx context.Context, req *http.Request) httputil.Result }
type ProtocolEndSessionHandler ¶
type ProtocolEndSessionHandler interface {
Handle(ctx context.Context, s session.ResolvedSession, endSessionRequest protocol.EndSessionRequest, r *http.Request, w http.ResponseWriter) error
}
type ProtocolIdentityService ¶
type ProtocolRevokeHandler ¶
type ProtocolRevokeHandler interface {
Handle(ctx context.Context, r protocol.RevokeRequest) error
}
type ProtocolTokenHandler ¶
type ProtocolTokenHandler interface {
Handle(ctx context.Context, rw http.ResponseWriter, req *http.Request, r protocol.TokenRequest) httputil.Result
}
type ProxyRedirectHandler ¶
type ProxyRedirectHandler struct {
ProxyRedirectHandler ProtocolProxyRedirectHandler
}
func (*ProxyRedirectHandler) ServeHTTP ¶
func (h *ProxyRedirectHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type RevokeHandler ¶
type RevokeHandler struct { Logger RevokeHandlerLogger Database *appdb.Handle RevokeHandler ProtocolRevokeHandler }
func (*RevokeHandler) ServeHTTP ¶
func (h *RevokeHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type RevokeHandlerLogger ¶
func NewRevokeHandlerLogger ¶
func NewRevokeHandlerLogger(lf *log.Factory) RevokeHandlerLogger
type TokenHandler ¶
type TokenHandler struct { Logger TokenHandlerLogger Database *appdb.Handle TokenHandler ProtocolTokenHandler }
func (*TokenHandler) ServeHTTP ¶
func (h *TokenHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type TokenHandlerLogger ¶
func NewTokenHandlerLogger ¶
func NewTokenHandlerLogger(lf *log.Factory) TokenHandlerLogger
type UserInfoHandler ¶
type UserInfoHandler struct { Logger UserInfoHandlerLogger Database *appdb.Handle UserInfoProvider ProtocolUserInfoProvider OAuth *config.OAuthConfig OAuthClientResolver OAuthClientResolver }
func (*UserInfoHandler) ServeHTTP ¶
func (h *UserInfoHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type UserInfoHandlerLogger ¶
func NewUserInfoHandlerLogger ¶
func NewUserInfoHandlerLogger(lf *log.Factory) UserInfoHandlerLogger
Click to show internal directories.
Click to hide internal directories.