v1

package
v0.0.6-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken      = errors.New("invalid token")
	ErrInvalidUserClaim  = errors.New("invalid user id claim")
	ErrInvalidEmailClaim = errors.New("invalid email claim")
)

Functions

func NewRouter

func NewRouter(
	logger *logging.Logger,
	ca ca.CertificateAuthority,
	serverKeyAttribtues *keystore.KeyAttributes,
	restHandlerRegistry RestHandlerRegistry,
	responseWriter response.HttpWriter) router.WebServiceRouter

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins   []string `yaml:"allowed-origins" json:"allowed_origins" mapstructure:"allowed-origins"`
	AllowedMethods   []string `yaml:"allowed-methods" json:"allowed_methods" mapstructure:"allowed-methods"`
	AllowedHeaders   []string `yaml:"allowed-headers" json:"allowed_headers" mapstructure:"allowed-headers"`
	AllowCredentials bool     `yaml:"allow-credentials" json:"allow_credentials" mapstructure:"allow-credentials"`
}

type Config

type Config struct {
	Certificate  Identity            `yaml:"certificate" json:"certificate" mapstructure:"certificate"`
	Home         string              `yaml:"home" json:"home" mapstructure:"home"`
	Index        string              `yaml:"index" json:"index" mapstructure:"index"`
	JWT          JWT                 `yaml:"jwt" json:"jwt" mapstructure:"jwt"`
	Key          *keystore.KeyConfig `yaml:"key" json:"key" mapstructure:"key"`
	Port         int                 `yaml:"port" json:"port" mapstructure:"port"`
	Proxy        *ProxyConfig        `yaml:"proxy" json:"proxy" mapstructure:"proxy"`
	RewriteRules []*RewriteRule      `yaml:"rewrite" json:"rewrite" mapstructure:"rewrite"`
	TLSPort      int                 `yaml:"tls-port" json:"tls_port" mapstructure:"tls-port"`
	VirtualHosts *[]VirtualHost      `yaml:"virtual-hosts" json:"virtual_hosts" mapstructure:"virtual-hosts"`
	WebAuthn     *WebAuthn           `yaml:"webauthn" json:"webauthn" mapstructure:"webauthn"`
	CORS         *CORSConfig         `yaml:"cors" json:"cors" mapstructure:"cors"`
}

type HandlerRegistry

type HandlerRegistry struct {
	RestHandlerRegistry
	// contains filtered or unexported fields
}

func (*HandlerRegistry) ACMERestService

func (registry *HandlerRegistry) ACMERestService() acmehandler.RestServicer

func (*HandlerRegistry) JSONWebTokenHandler

func (registry *HandlerRegistry) JSONWebTokenHandler() jwthandler.TokenHandler

func (*HandlerRegistry) SystemRestService

func (registry *HandlerRegistry) SystemRestService() system.RestHandler

func (*HandlerRegistry) WebAuthnRestService

func (registry *HandlerRegistry) WebAuthnRestService() webauthn.RestHandler

type Identity

type Identity struct {
	ACME    *acme.CertificateRequest    `yaml:"acme" json:"acme" mapstructure:"acme"`
	SANS    *ca.SubjectAlternativeNames `yaml:"sans" json:"sans" mapstructure:"sans"`
	Subject ca.Subject                  `yaml:"subject" json:"subject" mapstructure:"subject"`
	Valid   int                         `yaml:"valid" json:"valid" mapstructure:"valid"`
}

type JWT

type JWT struct {
	Expiration int64  `yaml:"expiration" json:"expiration" mapstructure:"expiration"`
	Issuer     string `yaml:"issuer" json:"issuer" mapstructure:"issuer"`
}

type ProxyConfig

type ProxyConfig struct {
	Backends []string `yaml:"backends" json:"backends" mapstructure:"backends"`
}

type RegistryParams

type RegistryParams struct {
	ACMEConfig          *acme.Config
	ACMEDAOFactory      dao.Factory
	CA                  ca.CertificateAuthority
	Debug               bool
	HTTPWriter          response.HttpWriter
	Keyring             *platform.Keyring
	JWTAudience         string
	JWTClaimsIssuer     string
	JWTExpiration       int
	Logger              *logging.Logger
	ServerKeyAttributes *keystore.KeyAttributes
	ServiceRegistry     *service.Registry
	TPM                 tpm2.TrustedPlatformModule
	WebServiceConfig    *Config
	WebAuthnConfig      *webauthn.Config
}

type RestHandlerRegistry

type RestHandlerRegistry interface {
	ACMERestService() acmehandler.RestServicer
	JSONWebTokenHandler() jwthandler.TokenHandler
	WebAuthnRestService() webauthn.RestHandler
}

func NewHandlerRegistry

func NewHandlerRegistry(params RegistryParams) RestHandlerRegistry

type RestService

type RestService interface {
	RegisterEndpoints(router *mux.Router, baseURI, baseFarmURI string) []string
}

type RewriteRule

type RewriteRule struct {
	Pattern string `yaml:"pattern" json:"pattern" mapstructure:"pattern"`
	Target  string `yaml:"target" json:"target" mapstructure:"target"`
}

type Router

type Router struct {
	router.WebServiceRouter
	// contains filtered or unexported fields
}

func (*Router) RegisterRoutes

func (v1Router *Router) RegisterRoutes(router *mux.Router)

Registers all websocket and REST services

type VirtualHost

type VirtualHost struct {
	Certificate  *Identity           `yaml:"certificate" json:"certificate" mapstructure:"certificate"`
	CORS         *CORSConfig         `yaml:"cors" json:"cors" mapstructure:"cors"`
	Home         string              `yaml:"home" json:"home" mapstructure:"home"`
	Hosts        []string            `yaml:"hosts" json:"hosts" mapstructure:"hosts"`
	Index        string              `yaml:"index" json:"index" mapstructure:"index"`
	Key          *keystore.KeyConfig `yaml:"key" json:"key" mapstructure:"key"`
	Proxy        *ProxyConfig        `yaml:"proxy" json:"proxy" mapstructure:"proxy"`
	RewriteRules []*RewriteRule      `yaml:"rewrite" json:"rewrite" mapstructure:"rewrite"`
}

type WebAuthn

type WebAuthn struct {
	RPDisplayName string   `yaml:"display-name" json:"display_name" mapstructure:"display-name"`
	RPID          string   `yaml:"id" json:"id" mapstructure:"id"`
	RPOrigins     []string `yaml:"origins" json:"origins" mapstructure:"origins"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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