tenant

package
v0.0.0-...-25b90bb Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter() *converter

func NewRepository

func NewRepository(conv Converter) *repository

func NewService

func NewService(tenant TenantRepository, transact persistence.Transactioner, uidService UIDService, config Config) *service

func RegisterHandler

func RegisterHandler(ctx context.Context, router *mux.Router, cfg Config, authConfig []authenticator.Config, transact persistence.Transactioner) error

Types

type Config

type Config struct {
	HandlerEndpoint string `envconfig:"APP_HANDLER_ENDPOINT,default=/v1/callback/{tenantId}"`
	TenantPathParam string `envconfig:"APP_TENANT_PATH_PARAM,default=tenantId"`

	TenantProviderTenantIdProperty string `envconfig:"APP_TENANT_PROVIDER_TENANT_ID_PROPERTY"`
	TenantProvider                 string `envconfig:"APP_TENANT_PROVIDER"`

	JWKSSyncPeriod            time.Duration `envconfig:"default=5m"`
	AllowJWTSigningNone       bool          `envconfig:"APP_ALLOW_JWT_SIGNING_NONE,default=true"`
	JwksEndpoints             string        `envconfig:"APP_JWKS_ENDPOINTS"`
	IdentityZone              string        `envconfig:"APP_TENANT_IDENTITY_ZONE"`
	SubscriptionCallbackScope string        `envconfig:"APP_SUBSCRIPTION_CALLBACK_SCOPE"`
}

type Converter

type Converter interface {
	ToEntity(in model.TenantModel) tenant.Entity
	FromEntity(in *tenant.Entity) *model.TenantModel
}

type TenantRepository

type TenantRepository interface {
	Create(ctx context.Context, item model.TenantModel) error
	DeleteByExternalID(ctx context.Context, tenantId string) error
}

type TenantService

type TenantService interface {
	Create(ctx context.Context, item model.TenantModel) error
	DeleteByExternalID(ctx context.Context, tenantId string) error
}

type UIDService

type UIDService interface {
	Generate() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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