config

package
v0.0.0-...-422f14d Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudFront

type CloudFront struct {
	KeyID      string     `envconfig:"PANOPTICON_CLOUDFRONT_KEY_ID"`
	PrivateKey PrivateKey `envconfig:"PANOPTICON_CLOUDFRONT_PRIVATE_KEY"`
	URL        URL        `envconfig:"PANOPTICON_CLOUDFRONT_URL,default=/"`
}

CloudFront contains settings for the app CDN.

type Config

type Config struct {
	aws.AWS `envconfig:"-"`

	AppURL *URL   `envconfig:"PANOPTICON_APP_URL"`
	Listen string `envconfig:"PANOPTICON_LISTEN,optional"`

	Development bool   `envconfig:"PANOPTICON_DEVELOPMENT,default=false"`
	SSMPrefix   string `envconfig:"PANOPTICON_SSM_PREFIX,optional"`

	CF   CloudFront
	Sess SessionStore
	SAML SAML
}

Config contains application settings.

func Load

func Load(ctx context.Context) (*Config, error)

Load reads settings from the environment.

type PrivateKey

type PrivateKey struct {
	Value *rsa.PrivateKey
}

PrivateKey represents a parsed RSA private key.

func (*PrivateKey) Unmarshal

func (k *PrivateKey) Unmarshal(s string) error

Unmarshal converts an environment variable string to a PrivateKey.

type SAML

type SAML struct {
	EntityID    string `envconfig:"PANOPTICON_SAML_ENTITY_ID,default=panopticon"`
	MetadataURL string `envconfig:"PANOPTICON_SAML_METADATA_URL"`
	Certificate string `envconfig:"PANOPTICON_SAML_CERTIFICATE"`
	PrivateKey  string `envconfig:"PANOPTICON_SAML_PRIVATE_KEY"`
}

SAML contains settings for SAML-based authentication.

type SessionStore

type SessionStore struct {
	Create   bool   `envconfig:"PANOPTICON_SESSION_CREATE,default=false"`
	Endpoint URL    `envconfig:"PANOPTICON_SESSION_ENDPOINT,optional"`
	Table    string `envconfig:"PANOPTICON_SESSION_TABLE"`
}

SessionStore contains setting for app sessions.

type URL

type URL struct {
	url.URL
}

URL represents a parsed URL

func (*URL) ResolveReference

func (u *URL) ResolveReference(ref *url.URL) *URL

ResolveReference proxies to net/url.URL.ResolveReference()

func (*URL) Unmarshal

func (u *URL) Unmarshal(s string) error

Unmarshal converts an environment variable string to a URL

Jump to

Keyboard shortcuts

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