mainserver

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package mainserver implements the main entry point logic for the server, managing CertAuth, CertSec, and Onboard services.

Index

Constants

View Source
const (
	ALTIA_LOCAL = "local"
	ALTIA_DEV   = "altia-dev"
	ISBE_DEV    = "isbe-dev"
	ISBE_PRE    = "isbe-pre"
	ISBE_PRO    = "isbe-pro"
)

We define several profiles, to facilitate configuration if an environment matches one of the profiles. To run the server in a specific profile, use the -profile flag or the PROFILE environment variable, with the value of the profile you want to use. No other environment variables are required when using a profile, except for the TSA and email server credentials.

Variables

This section is empty.

Functions

func GetBoolEnvOrDefault

func GetBoolEnvOrDefault(key string, defaultValue bool) bool

GetBoolEnvOrDefault gets an environment variable or returns a default value.

func GetStringEnvOrDefault

func GetStringEnvOrDefault(key, defaultValue string) string

GetStringEnvOrDefault gets an environment variable or returns a default value

Types

type Config

type Config struct {
	Development    bool
	OnboardURL     string
	OnboardPort    string
	PrivateArea    string
	TMFServerURL   string
	CertAuthConfig *certauth.Config
	PredefinedRPs  []PredefinedRP
}

Config is the configuration for the server. It contains the configuration for CertAuth, CertSec and Onboard servers.

func LoadConfig

func LoadConfig() (*Config, string, error)

LoadConfig parses flags, environment variables, and config files to return the server configuration.

type EmailCreds

type EmailCreds struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type PredefinedRP

type PredefinedRP struct {
	RelyingParty *models.RelyingParty
	ClientSecret string
}

type SecretConfig

type SecretConfig struct {
	AgeRecipient string     `yaml:"age_recipient"`
	TSACreds     TSACreds   `yaml:"tsa"`
	EmailCreds   EmailCreds `yaml:"email"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server manages the CertAuth, CertSec and Onboard servers

func New

func New(adminPassword string, cfg Config, profile string) (*Server, error)

New creates a new server instance. It initializes the database, cache, CertAuth, CertSec and Onboard servers.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts both servers: CertAuth and CertSec. It also starts the Onboarding test server if enabled

type TSACreds

type TSACreds struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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