Documentation ¶
Index ¶
- func MountAuthUIController(service *goa.Service, ctrl AuthUIController)
- func MountLoginController(service *goa.Service, ctrl LoginController)
- func MountOauth2ProviderController(service *goa.Service, ctrl Oauth2ProviderController)
- func MountPublicController(service *goa.Service, ctrl PublicController)
- func NewOAuth2Security() *goa.OAuth2Security
- func NewOauth2ClientBasicAuthSecurity() *goa.BasicAuthSecurity
- func UseOAuth2Middleware(service *goa.Service, middleware goa.Middleware)
- func UseOauth2ClientBasicAuthMiddleware(service *goa.Service, middleware goa.Middleware)
- type AuthUIController
- type AuthorizeOauth2ProviderContext
- type ConfirmAuthorizationAuthUIContext
- type GetTokenOauth2ProviderContext
- type LoginController
- type OAuth2ErrorMedia
- type Oauth2ProviderController
- type PromptAuthorizationAuthUIContext
- type PublicController
- type ShowLoginLoginContext
- type TokenMedia
- type TokenPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountAuthUIController ¶
func MountAuthUIController(service *goa.Service, ctrl AuthUIController)
MountAuthUIController "mounts" a AuthUI resource controller on the given service.
func MountLoginController ¶
func MountLoginController(service *goa.Service, ctrl LoginController)
MountLoginController "mounts" a Login resource controller on the given service.
func MountOauth2ProviderController ¶
func MountOauth2ProviderController(service *goa.Service, ctrl Oauth2ProviderController)
MountOauth2ProviderController "mounts" a Oauth2Provider resource controller on the given service.
func MountPublicController ¶
func MountPublicController(service *goa.Service, ctrl PublicController)
MountPublicController "mounts" a Public resource controller on the given service.
func NewOAuth2Security ¶
func NewOAuth2Security() *goa.OAuth2Security
NewOAuth2Security creates a OAuth2 security definition.
func NewOauth2ClientBasicAuthSecurity ¶
func NewOauth2ClientBasicAuthSecurity() *goa.BasicAuthSecurity
NewOauth2ClientBasicAuthSecurity creates a oauth2_client_basic_auth security definition.
func UseOAuth2Middleware ¶
func UseOAuth2Middleware(service *goa.Service, middleware goa.Middleware)
UseOAuth2Middleware mounts the OAuth2 auth middleware onto the service.
func UseOauth2ClientBasicAuthMiddleware ¶
func UseOauth2ClientBasicAuthMiddleware(service *goa.Service, middleware goa.Middleware)
UseOauth2ClientBasicAuthMiddleware mounts the oauth2_client_basic_auth auth middleware onto the service.
Types ¶
type AuthUIController ¶
type AuthUIController interface { goa.Muxer ConfirmAuthorization(*ConfirmAuthorizationAuthUIContext) error PromptAuthorization(*PromptAuthorizationAuthUIContext) error }
AuthUIController is the controller interface for the AuthUI actions.
type AuthorizeOauth2ProviderContext ¶
type AuthorizeOauth2ProviderContext struct { context.Context *goa.ResponseData *goa.RequestData ClientID string RedirectURI *string ResponseType string Scope *string State *string }
AuthorizeOauth2ProviderContext provides the oauth2_provider authorize action context.
func NewAuthorizeOauth2ProviderContext ¶
func NewAuthorizeOauth2ProviderContext(ctx context.Context, r *http.Request, service *goa.Service) (*AuthorizeOauth2ProviderContext, error)
NewAuthorizeOauth2ProviderContext parses the incoming request URL and body, performs validations and creates the context used by the oauth2_provider controller authorize action.
func (*AuthorizeOauth2ProviderContext) BadRequest ¶
func (ctx *AuthorizeOauth2ProviderContext) BadRequest(r *OAuth2ErrorMedia) error
BadRequest sends a HTTP response with status code 400.
func (*AuthorizeOauth2ProviderContext) Found ¶
func (ctx *AuthorizeOauth2ProviderContext) Found() error
Found sends a HTTP response with status code 302.
type ConfirmAuthorizationAuthUIContext ¶
type ConfirmAuthorizationAuthUIContext struct { context.Context *goa.ResponseData *goa.RequestData Confirmed *bool }
ConfirmAuthorizationAuthUIContext provides the authUI confirmAuthorization action context.
func NewConfirmAuthorizationAuthUIContext ¶
func NewConfirmAuthorizationAuthUIContext(ctx context.Context, r *http.Request, service *goa.Service) (*ConfirmAuthorizationAuthUIContext, error)
NewConfirmAuthorizationAuthUIContext parses the incoming request URL and body, performs validations and creates the context used by the authUI controller confirmAuthorization action.
func (*ConfirmAuthorizationAuthUIContext) BadRequest ¶
func (ctx *ConfirmAuthorizationAuthUIContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ConfirmAuthorizationAuthUIContext) InternalServerError ¶
func (ctx *ConfirmAuthorizationAuthUIContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
type GetTokenOauth2ProviderContext ¶
type GetTokenOauth2ProviderContext struct { context.Context *goa.ResponseData *goa.RequestData Payload *TokenPayload }
GetTokenOauth2ProviderContext provides the oauth2_provider get_token action context.
func NewGetTokenOauth2ProviderContext ¶
func NewGetTokenOauth2ProviderContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetTokenOauth2ProviderContext, error)
NewGetTokenOauth2ProviderContext parses the incoming request URL and body, performs validations and creates the context used by the oauth2_provider controller get_token action.
func (*GetTokenOauth2ProviderContext) BadRequest ¶
func (ctx *GetTokenOauth2ProviderContext) BadRequest(r *OAuth2ErrorMedia) error
BadRequest sends a HTTP response with status code 400.
func (*GetTokenOauth2ProviderContext) OK ¶
func (ctx *GetTokenOauth2ProviderContext) OK(r *TokenMedia) error
OK sends a HTTP response with status code 200.
type LoginController ¶
type LoginController interface { goa.Muxer ShowLogin(*ShowLoginLoginContext) error }
LoginController is the controller interface for the Login actions.
type OAuth2ErrorMedia ¶
type OAuth2ErrorMedia struct { // Error returned by authorization server Error string `form:"error" json:"error" xml:"error"` // Human readable ASCII text providing additional information ErrorDescription *string `form:"error_description,omitempty" json:"error_description,omitempty" xml:"error_description,omitempty"` // A URI identifying a human-readable web page with information about the error ErrorURI *string `form:"error_uri,omitempty" json:"error_uri,omitempty" xml:"error_uri,omitempty"` }
OAuth2 error response, see https://tools.ietf.org/html/rfc6749#section-5.2 (default view)
Identifier: application/vnd.goa.example.oauth2.error+json; view=default
func (*OAuth2ErrorMedia) Validate ¶
func (mt *OAuth2ErrorMedia) Validate() (err error)
Validate validates the OAuth2ErrorMedia media type instance.
type Oauth2ProviderController ¶
type Oauth2ProviderController interface { goa.Muxer Authorize(*AuthorizeOauth2ProviderContext) error GetToken(*GetTokenOauth2ProviderContext) error }
Oauth2ProviderController is the controller interface for the Oauth2Provider actions.
type PromptAuthorizationAuthUIContext ¶
type PromptAuthorizationAuthUIContext struct { context.Context *goa.ResponseData *goa.RequestData }
PromptAuthorizationAuthUIContext provides the authUI promptAuthorization action context.
func NewPromptAuthorizationAuthUIContext ¶
func NewPromptAuthorizationAuthUIContext(ctx context.Context, r *http.Request, service *goa.Service) (*PromptAuthorizationAuthUIContext, error)
NewPromptAuthorizationAuthUIContext parses the incoming request URL and body, performs validations and creates the context used by the authUI controller promptAuthorization action.
func (*PromptAuthorizationAuthUIContext) BadRequest ¶
func (ctx *PromptAuthorizationAuthUIContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*PromptAuthorizationAuthUIContext) InternalServerError ¶
func (ctx *PromptAuthorizationAuthUIContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
type PublicController ¶
type PublicController interface { goa.Muxer goa.FileServer }
PublicController is the controller interface for the Public actions.
type ShowLoginLoginContext ¶
type ShowLoginLoginContext struct { context.Context *goa.ResponseData *goa.RequestData }
ShowLoginLoginContext provides the login showLogin action context.
func NewShowLoginLoginContext ¶
func NewShowLoginLoginContext(ctx context.Context, r *http.Request, service *goa.Service) (*ShowLoginLoginContext, error)
NewShowLoginLoginContext parses the incoming request URL and body, performs validations and creates the context used by the login controller showLogin action.
func (*ShowLoginLoginContext) BadRequest ¶
func (ctx *ShowLoginLoginContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ShowLoginLoginContext) InternalServerError ¶
func (ctx *ShowLoginLoginContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*ShowLoginLoginContext) Unauthorized ¶
func (ctx *ShowLoginLoginContext) Unauthorized(r error) error
Unauthorized sends a HTTP response with status code 401.
type TokenMedia ¶
type TokenMedia struct { // The access token issued by the authorization server AccessToken string `form:"access_token" json:"access_token" xml:"access_token"` // The lifetime in seconds of the access token ExpiresIn *int `form:"expires_in,omitempty" json:"expires_in,omitempty" xml:"expires_in,omitempty"` // The refresh token RefreshToken *string `form:"refresh_token,omitempty" json:"refresh_token,omitempty" xml:"refresh_token,omitempty"` // The scope of the access token Scope *string `form:"scope,omitempty" json:"scope,omitempty" xml:"scope,omitempty"` // The type of the token issued, e.g. "bearer" or "mac" TokenType string `form:"token_type" json:"token_type" xml:"token_type"` }
OAuth2 access token request successful response, see https://tools.ietf.org/html/rfc6749#section-5.1 (default view)
Identifier: application/vnd.goa.example.oauth2.token+json; view=default
func (*TokenMedia) Validate ¶
func (mt *TokenMedia) Validate() (err error)
Validate validates the TokenMedia media type instance.
type TokenPayload ¶
type TokenPayload struct { // The authorization code received from the authorization server, used for initial refresh and access token request Code *string `form:"code,omitempty" json:"code,omitempty" xml:"code,omitempty"` // Value MUST be set to "authorization_code" when obtaining initial refresh and access token. // Value MUST be set to "refresh_token" when refreshing an access token. GrantType string `form:"grant_type" json:"grant_type" xml:"grant_type"` // The redirect_uri parameter specified when making the authorize request to obtain the authorization code, used for initial refresh and access token request RedirectURI *string `form:"redirect_uri,omitempty" json:"redirect_uri,omitempty" xml:"redirect_uri,omitempty"` // The refresh token issued to the client, used for refreshing an access token RefreshToken *string `form:"refresh_token,omitempty" json:"refresh_token,omitempty" xml:"refresh_token,omitempty"` // The scope of the access request, used for refreshing an access token Scope *string `form:"scope,omitempty" json:"scope,omitempty" xml:"scope,omitempty"` }
Payload sent by client to obtain refresh and access token or to refresh an access token. see https://tools.ietf.org/html/rfc6749#section-4.1.3 and https://tools.ietf.org/html/rfc6749#section-6
func (*TokenPayload) Validate ¶
func (ut *TokenPayload) Validate() (err error)
Validate validates the TokenPayload type instance.