config

package
v1.10.57 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const POSIX = "posix"
View Source
const S3 = "s3"

Variables

This section is empty.

Functions

func GetC4GHKey

func GetC4GHKey() (*[32]byte, error)

GetC4GHKey reads and decrypts and returns the c4gh key

Types

type AppConfig

type AppConfig struct {
	// Hostname for this web app
	// Optional. Default value localhost
	Host string

	// Port number for this web app
	// Optional. Default value 8080
	Port int

	// TLS server certificate for HTTPS
	// Optional. Defaults to empty
	ServerCert string

	// TLS server certificate key for HTTPS
	// Optional. Defaults to empty
	ServerKey string

	// Stores the Crypt4GH private key if the two configs above are set
	// Unconfigurable. Depends on Crypt4GHKeyFile and Crypt4GHPassFile
	Crypt4GHKey *[32]byte

	// Selected middleware for authentication and authorizaton
	// Optional. Default value is "default" for TokenMiddleware
	Middleware string
}

type DatabaseConfig

type DatabaseConfig struct {
	// Database hostname
	// Optional. Default value localhost
	Host string

	// Database port number
	// Optional. Default value 5432
	Port int

	// Database username
	// Optional. Default value lega_out
	User string

	// Database password for username
	// Optional. Default value lega_out
	Password string

	// Database name
	// Optional. Default value lega
	Database string

	// TLS CA cert for database connection
	// Optional.
	CACert string

	// CA cert for database connection
	// Optional.
	SslMode string

	// TLS Certificate for database connection
	// Optional.
	ClientCert string

	// TLS Key for database connection
	// Optional.
	ClientKey string
}

type Map added in v1.6.102

type Map struct {
	App     AppConfig
	Session SessionConfig
	DB      DatabaseConfig
	OIDC    OIDCConfig
	Archive storage.Conf
}

ConfigMap stores all different configs

var Config Map

Config is a global configuration value store

func NewConfig

func NewConfig() (*Map, error)

NewConfig populates ConfigMap with data

type OIDCConfig

type OIDCConfig struct {
	// OIDC OP configuration URL /.well-known/openid-configuration
	// Mandatory.
	ConfigurationURL string
	Whitelist        *jwk.MapWhitelist
	TrustedList      []TrustedISS
	CACert           string
}

type SessionConfig added in v1.1.0

type SessionConfig struct {
	// Session key expiration time in seconds.
	// Optional. Default value -1
	// Negative values disable the session and requires visa auth to be done on every request.
	// Positive values indicate amount of seconds the session stays active, e.g. 3600 for one hour.
	Expiration time.Duration

	// Cookie domain, this should be the hostname of the server.
	// Optional. Default value empty.
	Domain string

	// Cookie secure value. If true, cookie can only travel in HTTPS.
	// Optional. Default value true
	Secure bool

	// Cookie HTTPOnly value. If true, cookie can't be read by JavaScript.
	// Optional. Default value true
	HTTPOnly bool

	// Name of session cookie.
	// Optional. Default value sda_session_key
	Name string
}

type TrustedISS added in v1.6.0

type TrustedISS struct {
	ISS string `json:"iss"`
	JKU string `json:"jku"`
}

Jump to

Keyboard shortcuts

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