infrastructure

package
v0.0.0-...-354f3a1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectZapLogger

func InjectZapLogger(conf util.LoggerConfig)

func NewCognitoUserPoolClient

func NewCognitoUserPoolClient(region string, userPoolID string, clientID string) userpool.Client

func NewDummyIDGenerator

func NewDummyIDGenerator() entity.IDGenerator

* ID Generator *

func NewDummyIDValidator

func NewDummyIDValidator() entity.IDValidator

* ID Validator *

func NewDummyUsersReader

func NewDummyUsersReader(idManager entity.IDManager) entity.UsersReader

func NewDynamoDBAttributeValueMapper

func NewDynamoDBAttributeValueMapper() adapter.AttributeValueMapper

func NewDynamoDBClient

func NewDynamoDBClient(creds adapter.DynamoDBCredentials, region string) (*dynamoDBClient, error)

func NewDynamoDBClientFromEnv

func NewDynamoDBClientFromEnv(region string) (*dynamoDBClient, error)

func NewDynamoDBCredentials

func NewDynamoDBCredentials(accessKeyID string, secretAccessKey string) *dynamoDBCredentials

func NewSSMClient

func NewSSMClient(creds adapter.Credentials, region string) (adapter.Client, error)

func NewSSMClientFromEnv

func NewSSMClientFromEnv(region string) (adapter.Client, error)

func NewULIDGenerator

func NewULIDGenerator() entity.IDGenerator

* ID Generator *

func NewULIDValidator

func NewULIDValidator() entity.IDValidator

* ID Validator *

func NewUUIDGenerator

func NewUUIDGenerator() entity.IDGenerator

* ID Generator *

func NewUUIDValidator

func NewUUIDValidator() entity.IDValidator

* ID Validator *

func NewZapLogger

func NewZapLogger(conf util.LoggerConfig) (util.Logger, error)

Types

type JWTManager

type JWTManager interface {
	ReadRSAPrivatePemFile(path string) (jwk.Key, error)
	ReadJWKSetFile(path string) (jwk.Set, error)
	GenerateToken(subject string) (jwt.Token, error)
	Sign(token jwt.Token, key jwk.Key) ([]byte, error)
	Verify(signed []byte, key jwk.Key) ([]byte, error)
	VerifyWithKeySet(signed []byte, publicKeySet jwk.Set) ([]byte, error)
}

func NewJWTManager

func NewJWTManager(config TokenManagerConfig, idgen entity.IDGenerator) JWTManager

type SlackConfig

type SlackConfig struct {
	Channel  string
	UserName *string
	IconURL  *url.URL
}

type SlackNotifier

type SlackNotifier struct {
	// contains filtered or unexported fields
}

func NewSlackNotifier

func NewSlackNotifier(token string, config SlackConfig) *SlackNotifier

func (*SlackNotifier) Error

func (n *SlackNotifier) Error(ctx context.Context, title string, txt string) error

func (*SlackNotifier) Info

func (n *SlackNotifier) Info(ctx context.Context, title string, txt string) error

type TokenManagerConfig

type TokenManagerConfig interface {
	Issuer() string
	Audience() []string
	ValidityDuration() time.Duration
}

func NewTokenManagerConfig

func NewTokenManagerConfig(
	issuer string,
	audience []string,
	validityDuration time.Duration,
) TokenManagerConfig

Jump to

Keyboard shortcuts

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