Documentation ¶
Index ¶
- Constants
- func AccessTokenDecoder() *aclcore.AccessTokenDecoder
- func BootstrapArchiveDomain() archive.AsyncJobAdapter
- func BootstrapCatalogAndArchiveDomains() archive.AsyncJobAdapter
- func BootstrapCatalogDomain()
- func BootstrapOAuthDomain()
- func NewSSOAuthenticator() *aclcore.SSOAuthenticator
- type ArgParser
- func (a *ArgParser) BadRequest() (Response, error)
- func (a *ArgParser) HasViolations() bool
- func (a *ArgParser) ReadPathParameterInt(key string) int
- func (a *ArgParser) ReadPathParameterString(key string) string
- func (a *ArgParser) ReadQueryParameterBool(key string, mandatory bool) bool
- func (a *ArgParser) ReadQueryParameterInt(key string, mandatory bool) int
- type Response
- func BadRequest(body interface{}) (Response, error)
- func ForbiddenResponse(message string) (Response, error)
- func InternalError(cause error) (Response, error)
- func NewJsonResponse(code int, body interface{}, headers map[string]string) (Response, error)
- func NotFound(body interface{}) (Response, error)
- func Ok(body interface{}) (Response, error)
- func RequiresCatalogACL(request *events.APIGatewayProxyRequest, ...) (Response, error)
- func RequiresCatalogView(request *events.APIGatewayProxyRequest, ...) (Response, error)
- func UnauthorizedResponse(message string) (Response, error)
Constants ¶
const ( JWTIssuer = "DPHOTO_JWT_ISSUER" JWTKeyB64 = "DPHOTO_JWT_KEY_B64" JWTValidity = "DPHOTO_JWT_VALIDITY" DynamoDBTableName = "CATALOG_TABLE_NAME" )
Variables ¶
This section is empty.
Functions ¶
func AccessTokenDecoder ¶
func AccessTokenDecoder() *aclcore.AccessTokenDecoder
func BootstrapArchiveDomain ¶
func BootstrapArchiveDomain() archive.AsyncJobAdapter
func BootstrapCatalogAndArchiveDomains ¶
func BootstrapCatalogAndArchiveDomains() archive.AsyncJobAdapter
BootstrapCatalogAndArchiveDomains bootstraps all domains
func BootstrapCatalogDomain ¶
func BootstrapCatalogDomain()
BootstrapCatalogDomain bootstraps both oauth and catalog
func NewSSOAuthenticator ¶
func NewSSOAuthenticator() *aclcore.SSOAuthenticator
Types ¶
type ArgParser ¶
type ArgParser struct {
// contains filtered or unexported fields
}
ArgParser is a helper to read several parameters from the request
func NewArgParser ¶
func NewArgParser(request *events.APIGatewayProxyRequest) *ArgParser
func (*ArgParser) BadRequest ¶
func (*ArgParser) HasViolations ¶
func (*ArgParser) ReadPathParameterInt ¶
func (*ArgParser) ReadPathParameterString ¶
func (*ArgParser) ReadQueryParameterBool ¶
type Response ¶
type Response events.APIGatewayProxyResponse
func BadRequest ¶
func ForbiddenResponse ¶
func InternalError ¶
InternalError logs the error and create a 500 error response
func NewJsonResponse ¶
NewJsonResponse serialises body into JSON and create a Response containing it as body.
func RequiresCatalogACL ¶
func RequiresCatalogACL(request *events.APIGatewayProxyRequest, process func(claims aclcore.Claims, rules catalogacl.CatalogRules) (Response, error)) (Response, error)
RequiresCatalogACL parses the token and instantiate the ACL extension for 'catalog' domain
accesscontrol.AccessUnauthorisedError errors will be converted into 401 responses accesscontrol.AccessForbiddenError errors will be converted into 403 responses any other errors will be converted into 500
func RequiresCatalogView ¶
func RequiresCatalogView(request *events.APIGatewayProxyRequest, process func(catalogView *catalogaclview.View) (Response, error)) (Response, error)
RequiresCatalogView is based on RequiresCatalogACL but creates a convenient Catalog View