config

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Providers

func NewProviders

func NewProviders(ctx context.Context, cfg *ServiceConfig, httpClient *http.Client, template embed.FS) (*Providers, error)

func (*Providers) FetchAllUserIds

func (p *Providers) FetchAllUserIds(ctx context.Context) ([]string, error)

func (*Providers) FetchAllUserProfiles

func (p *Providers) FetchAllUserProfiles(ctx context.Context) ([]*idmv1.Profile, error)

func (*Providers) VerifyUserExists

func (p *Providers) VerifyUserExists(ctx context.Context, id string) error

type ServiceConfig

type ServiceConfig struct {
	// IdentityProvider holds the address of the identity provider.
	IdentityProvider string `env:"IDM_URL,default=http://cisidm:8081"`
	// JWTSecret holds the secret to validate JWTs issued by CIS.
	JWTSecret string `env:"JWT_SECRET,required"`
	// DatabaseURL is the mongodb connection URL
	DatabaseURL string `env:"DATABASE_URL,required"`
	// DatabaseName is the name of the mongodb database.
	DatabaseName string `env:"DATABASE_NAME,required"`
	// Address holds the listen address of the HTTP server.
	Address string `env:"ADDRESS,default=:8080"`
	// AdminAddress holds the address of the unauthenticated admin endpoint.
	AdminAddress string `env:"ADMIN_ADDRESS,default=:8081"`
	// Country is the two-letter country code of legal residence used
	// for public holiday detection.
	Country string `env:"COUNTRY,default=AT"`
	// CalendarServiceURL holds the URL of the calendar service.
	CalendarService string `env:"CALENDAR_SERVICE_URL,default=http://ciscal:8080"`
	// PublicURL is the public URL to rosterd
	PublicURL string `env:"PUBLIC_URL"`
	// PreviewRosterURL should be set to the format string accepting year and month
	// (in this order) to build a public link to access a readonly version of the roster.
	// If left empty, this defaults to {{ PublicURL }}/roster/view/%s
	PreviewRosterURL string `env:"PREVIEW_ROSTER_URL"`
	// TemplatesDir might be set to a directory path containing mail and SMS template
	// files. If set, any files in TemplateDir will overwrite the embedded templates
	// of the final rosterd binary.
	TemplatesDir string `env:"TEMPLATES_PATH"`
	// AllowedOrigins configures the allowed CORS domains.
	AllowedOrigins []string `env:"ALLOWED_ORIGINS"`
	// RosterManagerRoleID holds the ID of the roster_manager role
	RosterManagerRoleID string `env:"ROSTER_MANAGER_ROLE_ID"`
	// Path or URL for the rosterd frontend
	StaticFiles string `env:"STATIC_FILES"`
}

func Read

func Read(ctx context.Context) (*ServiceConfig, error)

Read reads the service configuration from environment variables

Jump to

Keyboard shortcuts

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