Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface {
Authorize(userID string, roles []string, request Request) (bool, error)
}
Authorizer interface used to decide if a user has access to a specific resource.
type Request ¶
type Request events.APIGatewayProxyRequest
Request is of type APIGatewayProxyRequest since we're leveraging the AWS Lambda Proxy Request functionality (default behavior)
https://serverless.com/framework/docs/providers/aws/events/apigateway/#lambda-proxy-integration
type RequestHandler ¶
RequestHandler is called to handle an incoming HTTP request.
func NewAdminAuthorizationHandler ¶
func NewAdminAuthorizationHandler(handler SecuredRequestHandler) RequestHandler
NewAdminAuthorizationHandler only allow admin users to access.
func NewAuthorizationByRolesHandler ¶
func NewAuthorizationByRolesHandler(handler SecuredRequestHandler, roles []string) RequestHandler
NewAuthorizationByRolesHandler only allow admin users to access.
func NewAuthorizationHandler ¶
func NewAuthorizationHandler(handler SecuredRequestHandler, authorizer Authorizer) RequestHandler
NewAuthorizationHandler checks if the user from our token has access to the resource at hand via a custom authorizer.
type Response ¶
type Response events.APIGatewayProxyResponse
Response is of type APIGatewayProxyResponse since we're leveraging the AWS Lambda Proxy Request functionality (default behavior)
https://serverless.com/framework/docs/providers/aws/events/apigateway/#lambda-proxy-integration