Documentation ¶
Index ¶
- Variables
- func NewSecuredService(logger *log.Logger) securedservice.Service
- func SecuredServiceAPIKeyAuth(ctx context.Context, key string, s *security.APIKeyScheme) (context.Context, error)
- func SecuredServiceBasicAuth(ctx context.Context, user, pass string, s *security.BasicScheme) (context.Context, error)
- func SecuredServiceJWTAuth(ctx context.Context, token string, s *security.JWTScheme) (context.Context, error)
- func SecuredServiceOAuth2Auth(ctx context.Context, token string, s *security.OAuth2Scheme) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // are invalid. ErrUnauthorized error = securedservice.Unauthorized("invalid username and password combination") // ErrInvalidToken is the error returned when the JWT token is invalid. ErrInvalidToken error = securedservice.Unauthorized("invalid token") // ErrInvalidTokenScopes is the error returned when the scopes provided in // the JWT token claims are invalid. ErrInvalidTokenScopes error = securedservice.InvalidScopes("invalid scopes in token") // Key is the key used in JWT authentication Key = []byte("secret") )
Functions ¶
func NewSecuredService ¶
func NewSecuredService(logger *log.Logger) securedservice.Service
NewSecuredService returns the secured_service service implementation.
func SecuredServiceAPIKeyAuth ¶
func SecuredServiceAPIKeyAuth(ctx context.Context, key string, s *security.APIKeyScheme) (context.Context, error)
SecuredServiceAPIKeyAuth implements the authorization logic for service "secured_service" for the "api_key" security scheme.
func SecuredServiceBasicAuth ¶
func SecuredServiceBasicAuth(ctx context.Context, user, pass string, s *security.BasicScheme) (context.Context, error)
SecuredServiceBasicAuth implements the authorization logic for service "secured_service" for the "basic" security scheme.
func SecuredServiceJWTAuth ¶
func SecuredServiceJWTAuth(ctx context.Context, token string, s *security.JWTScheme) (context.Context, error)
SecuredServiceJWTAuth implements the authorization logic for service "secured_service" for the "jwt" security scheme.
func SecuredServiceOAuth2Auth ¶
func SecuredServiceOAuth2Auth(ctx context.Context, token string, s *security.OAuth2Scheme) (context.Context, error)
SecuredServiceOAuth2Auth implements the authorization logic for service "secured_service" for the "oauth2" security scheme.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.