config

package
v0.0.0-...-56de86b Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTLS

func BuildTLS(opts TLS) (*tls.Config, error)

buildConfig reads command-line options and builds a tls.Config

Types

type AuthenticatingProxy

type AuthenticatingProxy struct {
	Hostname         string        `yaml:"hostname"`           // Expected hostname of the authenticating proxy
	UsernameHeader   string        `yaml:"username_header"`    // Username header key the authenticating proxy will use
	AllowedSpiffeIds []spiffeid.ID `yaml:"allowed_spiffe_ids"` // A list of SPIFFE IDs that can be used for authentcation
}

An AuthenticatingProxy represents a known entity that will perform authentication of incoming requests to Sharkey.

The authenticating proxy connection can be validated with either a hostname in the TLS connection OR by a SPIFFE ID contained in the certificate used for the TLS connection.

type Config

type Config struct {
	Database            Database             `yaml:"db"`
	TLS                 TLS                  `yaml:"tls"`
	SigningKey          string               `yaml:"signing_key"`
	HostCertDuration    string               `yaml:"host_cert_duration"`
	UserCertDuration    string               `yaml:"user_cert_duration"`
	ListenAddr          string               `yaml:"listen_addr"`
	StripSuffix         string               `yaml:"strip_suffix"`
	Aliases             map[string][]string  `yaml:"aliases"`
	ExtraAuthorities    []string             `yaml:"extra_authorities"`
	ExtraKnownHosts     []string             `yaml:"extra_known_hosts"`
	AuthenticatingProxy *AuthenticatingProxy `yaml:"auth_proxy"`
	SSH                 SSH                  `yaml:"ssh"`
	GitHub              GitHub               `yaml:"github"`
	Telemetry           Telemetry            `yaml:"telemetry"`
}

func Load

func Load(file string) (conf Config, err error)

type Database

type Database struct {
	Username string
	Password string
	Address  string
	Schema   string
	Type     string
	TLS      *TLS
}

type GitHub

type GitHub struct {
	IncludeUserIdentity bool          `yaml:"include_user_identity"`
	AppId               int64         `yaml:"app_id"`
	InstallationId      int64         `yaml:"installation_id"`
	PrivateKeyPath      string        `yaml:"private_key_path"`
	OrganizationName    string        `yaml:"organization_name"`
	SyncInterval        time.Duration `yaml:"sync_interval"`
	SyncEnabled         bool          `yaml:"sync_enabled"`
}

type SSH

type SSH struct {
	UserCertExtensions []string `yaml:"user_cert_extensions"`
}

type TLS

type TLS struct {
	CA   string
	Cert string
	Key  string
}

type Telemetry

type Telemetry struct {
	Address string `yaml:"address"`
}

Jump to

Keyboard shortcuts

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