config

package
v0.0.0-...-6aee27a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WelcomeFlag is for testing purposes -- displays a welcome message on the operations page
	WelcomeFlag string = "welcome-message"
	// AllowMetadataEdit tells the frontend that it can render the metadata-editing capabilities
	AllowMetadataEdit string = "allow-metadata-edit"
)

Supported Flags

Variables

This section is empty.

Functions

func AWSRegion

func AWSRegion() string

AWSRegion retrieves the APP_IMGSTORE_REGION value from the environment

func CSRFAuthKey

func CSRFAuthKey() string

CSRFAuthKey retrieves the APP_CSRF_AUTH_KEY value from the environment

func DBUri

func DBUri() string

DBUri retrieves the environment variable DB_URI

func EmailFromAddress

func EmailFromAddress() string

EmailFromAddress contains the from address for all outgoing emails

func EmailHost

func EmailHost() string

EmailHost contains the location of the (presumably smtp) host that the email servicer will connect to

func EmailIdentity

func EmailIdentity() string

EmailIdentity contains the identity feature when using an Plain SMTP authentication

func EmailPassword

func EmailPassword() string

EmailPassword contains the "password" part of the information needed to authenticate with the email host

func EmailSMTPAuthType

func EmailSMTPAuthType() string

EmailSMTPAuthType contains the option for how to authenticate with the smtp service

func EmailSecret

func EmailSecret() string

EmailSecret contains the secret needed when using CRAMMD5 SMTP authentication

func EmailType

func EmailType() string

EmailType contains the type of email servicer to use (e.g. STMP vs memory-based solution)

func EmailUserName

func EmailUserName() string

EmailUserName contains the "username" part of the information needed to authenticate with the email host

func EnableEvidenceExport

func EnableEvidenceExport() bool

func Flags

func Flags() []string

Flags returns a list of all of the flags that were loaded from the environment. This is cached for speedier access later

func FrontendIndexURL

func FrontendIndexURL() string

FrontendIndexURL retrieves the APP_FRONTEND_INDEX_URL value from the environment

func HasFlag

func HasFlag(flagName string) bool

func ImageStoreBucketName

func ImageStoreBucketName() string

ImageStoreBucketName retrieves the APP_IMGSTORE_BUCKET_NAME value from the environment

func LoadAPIConfig

func LoadAPIConfig() error

LoadAPIConfig loads all of the environment configuration from environment variables. This version exists primarily to load data for the "API" / tools server

func LoadWebConfig

func LoadWebConfig() error

LoadWebConfig loads all of the environment configuration from environment variables. This version exists primarily to load data for the "Web" / UI server

func Port

func Port() string

Port retrieves the APP_PORT value from the environment

func RecoveryExpiry

func RecoveryExpiry() time.Duration

RecoveryExpiry retrieves the APP_RECOVERY_EXPIRY value from the environment

func SessionStoreKey

func SessionStoreKey() string

SessionStoreKey retrieves the SESSION_STORE_KEY value from the environment

func StoreBucket

func StoreBucket() string

func StoreRegion

func StoreRegion() string

func StoreType

func StoreType() string

func SupportedAuthServices

func SupportedAuthServices() []string

SupportedAuthServices retrieves the parsed AUTH_SERVICES value from the environment

func UseLambdaRIE

func UseLambdaRIE() bool

Types

type AuthConfig

type AuthConfig struct {
	Services    []string
	AuthConfigs map[string]AuthInstanceConfig
}

AuthConfig provides configuration details for all authentication services

type AuthInstanceConfig

type AuthInstanceConfig struct {
	Type                string
	Name                string
	RegistrationEnabled bool `ignored:"true"`
	OIDCConfig
	WebauthnConfig
}

AuthInstanceConfig provides all of the _possible_ configuration values for an auth instance. Note: it is expected that not all fields will be populated. It is up to the user to verify that these fields exist and have correct values

func AuthConfigInstance

func AuthConfigInstance(name string) AuthInstanceConfig

AuthConfigInstance attempts to retrieve a particular auth configuration set from the environment. Note this looks for environment variables prefixed with AUTH_${SERVICE_NAME}, and will only retrieve these values for services named in the AUTH_SERVICES environment

type ContentStoreConfig

type ContentStoreConfig struct {
	Type           string `split_words:"true"`
	Bucket         string `split_words:"true"`
	Region         string `split_words:"true"`
	S3UsePathStyle bool   `split_words:"true"`
}

func AllStoreConfig

func AllStoreConfig() ContentStoreConfig

type DBConfig

type DBConfig struct {
	URI string `required:"true"`
}

DBConfig provides configuration details on connecting to the backend database

type EmailConfig

type EmailConfig struct {
	FromAddress  string `split_words:"true"`
	Type         string `split_words:"true"`
	Host         string `split_words:"true"`
	UserName     string `split_words:"true"`
	Password     string `split_words:"true"`
	Identity     string `split_words:"true"`
	Secret       string `split_words:"true"`
	SMTPAuthType string `split_words:"true"`
}

EmailConfig is a struct that houses the configuration details related specifically to the (optional) email services

type OIDCConfig

type OIDCConfig struct {
	FriendlyName          string `split_words:"true"`
	ProviderURL           string `split_words:"true"`
	ClientID              string `split_words:"true"`
	ClientSecret          string `split_words:"true"`
	Scopes                string
	ProfileFirstNameField string `split_words:"true"`
	ProfileLastNameField  string `split_words:"true"`
	ProfileEmailField     string `split_words:"true"`
	ProfileSlugField      string `split_words:"true"`
}

type WebConfig

type WebConfig struct {
	ImgstoreBucketName       string        `split_words:"true"`
	ImgstoreRegion           string        `split_words:"true"`
	CsrfAuthKey              string        `split_words:"true"`
	SessionStoreKey          string        `split_words:"true"`
	RecoveryExpiry           time.Duration `split_words:"true" default:"24h"`
	DisableLocalRegistration bool          `split_words:"true"`
	FrontendIndexURL         string        `split_words:"true"`
	BackendURL               string        `split_words:"true"`
	SuccessRedirectURL       string        `split_words:"true"`
	FailureRedirectURLPrefix string        `split_words:"true"`
	UseLambdaRIE             bool          `split_words:"true"`
	EnableEvidenceExport     bool          `split_words:"true"`
	Flags                    string
	Port                     int
}

WebConfig is a namespaced app-specific configuration.

func AllAppConfig

func AllAppConfig() WebConfig

type WebauthnConfig

type WebauthnConfig struct {
	DisplayName string `split_words:"true"`
	// All of the below have innate defaults, and so are effectively optional
	Timeout                         int
	RPOrigin                        string `envconfig:"RP_ORIGIN"`
	AttestationPreference           string `split_words:"true"`
	Debug                           bool
	AuthenticatorAttachment         string `split_words:"true"`
	AuthenticatorResidentKey        string `split_words:"true"`
	AuthenticatorRequireResidentKey *bool  `split_words:"true"`
	AuthenticatorUserVerification   string `split_words:"true"`
}

func (WebauthnConfig) AuthenticatorAttachmentPreference

func (w WebauthnConfig) AuthenticatorAttachmentPreference() protocol.AuthenticatorAttachment

func (WebauthnConfig) AuthenticatorResidentKeyPreference

func (w WebauthnConfig) AuthenticatorResidentKeyPreference() protocol.ResidentKeyRequirement

func (WebauthnConfig) AuthenticatorUserVerificationPreference

func (w WebauthnConfig) AuthenticatorUserVerificationPreference() protocol.UserVerificationRequirement

func (WebauthnConfig) BuildAuthenticatorSelection

func (w WebauthnConfig) BuildAuthenticatorSelection() protocol.AuthenticatorSelection

func (WebauthnConfig) Conveyance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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