common

package
v0.0.0-...-1283c81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JWTIssuer            = "DPHOTO_JWT_ISSUER"
	JWTKeyB64            = "DPHOTO_JWT_KEY_B64"
	JWTValidity          = "DPHOTO_JWT_VALIDITY"
	RefreshTokenValidity = "DPHOTO_REFRESH_TOKEN_VALIDITY"
	DynamoDBTableName    = "CATALOG_TABLE_NAME"
	StorageBucketName    = "STORAGE_BUCKET_NAME"
	CacheBucketName      = "CACHE_BUCKET_NAME"
	SNSArchiveARN        = "SNS_ARCHIVE_ARN"
	SQSArchiveURL        = "SQS_ARCHIVE_URL"
)

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 BootstrapOAuthDomain

func BootstrapOAuthDomain()

BootstrapOAuthDomain only bootstraps oauth

func GetIdentityQueries

func GetIdentityQueries() *aclcore.IdentityQueries

func MustAWSFactory

func MustAWSFactory(ctx context.Context) awsfactory.AWSFactory

func NewLogout

func NewLogout() *aclcore.Logout

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.APIGatewayV2HTTPRequest) *ArgParser

func (*ArgParser) BadRequest

func (a *ArgParser) BadRequest() (Response, error)

func (*ArgParser) HasViolations

func (a *ArgParser) HasViolations() bool

func (*ArgParser) ReadPathParameterInt

func (a *ArgParser) ReadPathParameterInt(key string) int

func (*ArgParser) ReadPathParameterString

func (a *ArgParser) ReadPathParameterString(key string) string

func (*ArgParser) ReadQueryParameterBool

func (a *ArgParser) ReadQueryParameterBool(key string, mandatory bool) bool

func (*ArgParser) ReadQueryParameterInt

func (a *ArgParser) ReadQueryParameterInt(key string, mandatory bool) int

type LambdaViperNames

type LambdaViperNames struct{}

func (*LambdaViperNames) ArchiveCacheBucketName

func (l *LambdaViperNames) ArchiveCacheBucketName() string

func (*LambdaViperNames) ArchiveJobsSNSARN

func (l *LambdaViperNames) ArchiveJobsSNSARN() string

func (*LambdaViperNames) ArchiveJobsSQSURL

func (l *LambdaViperNames) ArchiveJobsSQSURL() string

func (*LambdaViperNames) ArchiveMainBucketName

func (l *LambdaViperNames) ArchiveMainBucketName() string

func (*LambdaViperNames) DynamoDBName

func (l *LambdaViperNames) DynamoDBName() string

type Response

func BadRequest

func BadRequest(body interface{}) (Response, error)

func ForbiddenResponse

func ForbiddenResponse(message string) (Response, error)

func HandleError

func HandleError(err error) (Response, error)

func InternalError

func InternalError(cause error) (Response, error)

InternalError logs the error and create a 500 error response

func NewJsonResponse

func NewJsonResponse(code int, body interface{}, headers map[string]string) (Response, error)

NewJsonResponse serialises body into JSON and create a Response containing it as body.

func NoContent

func NoContent() (Response, error)

func NotFound

func NotFound(body interface{}) (Response, error)

func Ok

func Ok(body interface{}) (Response, error)

func RequiresAuthenticated

func RequiresAuthenticated(request *events.APIGatewayV2HTTPRequest, process func(user usermodel.CurrentUser) (Response, error)) (Response, error)

func UnauthorizedResponse

func UnauthorizedResponse(message string) (Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL