server

package
v0.0.0-...-7349942 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package server builds and runs the ssh-inscribe HTTP(S) server.

Index

Constants

This section is empty.

Variables

View Source
var Defaults = &Config{
	Listen:       ":8540",
	TLSCertFile:  "",
	TLSKeyFile:   "",
	TLSCertFiles: []string{},
	TLSKeyFiles:  []string{},
	AuthBackends: []AuthBackend{
		{
			Type:    "authfile",
			Config:  "authfile",
			Default: false,
		},
	},
	DefaultAuthBackends:       []string{},
	MaxCertLifetime:           "24h",
	DefaultCertLifetime:       "1h",
	CaChallengeLifetime:       "5m",
	AgentSocket:               path.Join(globals.VarDir(), "ssh_inscribe_agent.sock"),
	PKCS11Provider:            "",
	PKCS11Pin:                 "",
	CertSigningKeyFingerprint: "",
	TokenSigningKey:           "",
}
View Source
var Log = logging.GetLogger("server").WithField("pkg", "server")

Functions

func RecoverHandler

func RecoverHandler(lf logrus.Fields) echo.MiddlewareFunc

Simplified version of the echo's recover handler with support for logrus logging

func RequestLogger

func RequestLogger(lf logrus.Fields) echo.MiddlewareFunc

Types

type AuthBackend

type AuthBackend struct {
	Type    string
	Config  string
	Default bool
}

type CertificateConfig

type CertificateConfig struct {
	Certificates   []tls.Certificate
	CertificateMap map[string]*tls.Certificate
}

func (CertificateConfig) GetCertificate

func (cc CertificateConfig) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate selects a certificate by the TLS server name, exactly or by a wildcard for the first label, like the deprecated tls.Config.NameToCertificate did. It returns nil when there is no match so that crypto/tls falls back to its default selection.

type Config

type Config struct {
	Listen                    string
	TLSCertFile               string        `yaml:"TLSCertFile"`
	TLSKeyFile                string        `yaml:"TLSKeyFile"`
	TLSCertFiles              []string      `yaml:"TLSCertFiles"`
	TLSKeyFiles               []string      `yaml:"TLSKeyFiles"`
	TLSCertNames              []string      `yaml:"TLSCertNames"`
	AuthBackends              []AuthBackend `yaml:"authBackends"`
	DefaultAuthBackends       []string      `yaml:"defaultAuthBackends"`
	MaxCertLifetime           string        `yaml:"maxCertLifetime"`
	DefaultCertLifetime       string        `yaml:"defaultCertLifetime"`
	CaChallengeLifetime       string        `yaml:"caChallengeLifetime"`
	AgentSocket               string        `yaml:"agentSocket"`
	PKCS11Provider            string        `yaml:"pkcs11Provider"`
	PKCS11Pin                 string        `yaml:"pkcs11Pin"`
	CertSigningKeyFingerprint string        `yaml:"certSigningKeyFingerprint"`
	TokenSigningKey           string        `yaml:"tokenSigningKey"`
}

func (Config) GetCertificateMap

func (c Config) GetCertificateMap() (cc CertificateConfig, err error)

type Server

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

func Build

func Build() (*Server, error)

func (*Server) Start

func (s *Server) Start() error

Start serves the API until the server fails or is closed.

Directories

Path Synopsis
Package signapi implements the v1 HTTP API: login, certificate signing and CA key management.
Package signapi implements the v1 HTTP API: login, certificate signing and CA key management.
objects
Package objects contains types shared by the API server and client.
Package objects contains types shared by the API server and client.

Jump to

Keyboard shortcuts

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