Documentation
¶
Index ¶
- Constants
- func HTTPGatewayComposeService(files HTTPGatewayFiles, spec HTTPGatewaySpec) string
- func LoopbackHTTPSURL(port int) (string, error)
- func NewHTTPClient(material TLSMaterial, requireClient bool) (*http.Client, error)
- func NewHTTPClientForPolicy(material TLSMaterial, policy Policy) (*http.Client, error)
- func NewHTTPClientWithBasicAuth(material TLSMaterial, username, password string) (*http.Client, error)
- func TCPGatewayComposeService(files TCPGatewayFiles, spec TCPGatewaySpec) string
- func WaitHTTPS(ctx context.Context, client *http.Client, endpoint, path string) error
- type AuthenticationMode
- type CertificateRequest
- type HTTPGatewayFiles
- type HTTPGatewaySpec
- type IssuedCertificate
- type Issuer
- type IssuerStatus
- type LifecycleObservation
- type NativeTLSFiles
- type PKISource
- type Policy
- type TCPGatewayFiles
- type TCPGatewaySpec
- type TLSMaterial
- type TrustBundle
Constants ¶
View Source
const ( EnvPKISource = "BASEHARBOR_SERVICE_PKI_SOURCE" EnvTLSCertFile = "BASEHARBOR_SERVICE_TLS_CERT_FILE" EnvTLSKeyFile = "BASEHARBOR_SERVICE_TLS_KEY_FILE" EnvTrustBundle = "BASEHARBOR_SERVICE_TLS_TRUST_FILE" EnvClientCertFile = "BASEHARBOR_SERVICE_TLS_CLIENT_CERT_FILE" EnvClientKeyFile = "BASEHARBOR_SERVICE_TLS_CLIENT_KEY_FILE" EnvIssuerRef = "BASEHARBOR_SERVICE_PKI_ISSUER_REF" EnvServerName = "BASEHARBOR_SERVICE_TLS_SERVER_NAME" EnvAuthentication = "BASEHARBOR_SERVICE_AUTHENTICATION" EnvAuthTokenFile = "BASEHARBOR_SERVICE_AUTH_TOKEN_FILE" )
View Source
const GatewayImage = "docker.io/library/caddy:2.11.4-alpine"
View Source
const TCPGatewayImage = "docker.io/library/haproxy:3.2.23-alpine"
Variables ¶
This section is empty.
Functions ¶
func HTTPGatewayComposeService ¶
func HTTPGatewayComposeService(files HTTPGatewayFiles, spec HTTPGatewaySpec) string
func LoopbackHTTPSURL ¶
func NewHTTPClient ¶
func NewHTTPClient(material TLSMaterial, requireClient bool) (*http.Client, error)
func NewHTTPClientForPolicy ¶
func NewHTTPClientForPolicy(material TLSMaterial, policy Policy) (*http.Client, error)
func NewHTTPClientWithBasicAuth ¶ added in v0.4.17
func NewHTTPClientWithBasicAuth(material TLSMaterial, username, password string) (*http.Client, error)
func TCPGatewayComposeService ¶
func TCPGatewayComposeService(files TCPGatewayFiles, spec TCPGatewaySpec) string
Types ¶
type AuthenticationMode ¶
type AuthenticationMode string
const ( AuthenticationNone AuthenticationMode = "none" AuthenticationNative AuthenticationMode = "native" AuthenticationMTLS AuthenticationMode = "mtls" AuthenticationToken AuthenticationMode = "token" AuthenticationOIDC AuthenticationMode = "oidc" AuthenticationOAuth2 AuthenticationMode = "oauth2" AuthenticationExternal AuthenticationMode = "external" )
type CertificateRequest ¶
type HTTPGatewayFiles ¶
type HTTPGatewayFiles struct {
Dir string
Caddyfile string
Material TLSMaterial
AuthToken string
}
func EnsureHTTPGateway ¶
func EnsureHTTPGateway(ctx context.Context, issuer Issuer, policy Policy, providerDir string, spec HTTPGatewaySpec) (HTTPGatewayFiles, error)
type HTTPGatewaySpec ¶
type IssuedCertificate ¶
type Issuer ¶
type Issuer interface {
TrustBundle(ctx context.Context) (TrustBundle, error)
Issue(ctx context.Context, request CertificateRequest) (IssuedCertificate, error)
Renew(ctx context.Context, current IssuedCertificate, request CertificateRequest) (IssuedCertificate, error)
Revoke(ctx context.Context, serial string) error
Status(ctx context.Context) (IssuerStatus, error)
}
Issuer is the provider-neutral certificate authority boundary used by service access. Implementations own issuer state and lifecycle; callers only receive the leaf material and public trust required for the selected runtime.
type IssuerStatus ¶
type LifecycleObservation ¶
type LifecycleObservation struct {
Source PKISource `json:"source"`
LifecycleOwner string `json:"lifecycle_owner"`
RenewalMode string `json:"renewal_mode"`
IssuerReference string `json:"issuer_reference,omitempty"`
ServerExpiresAt time.Time `json:"server_expires_at"`
ClientExpiresAt time.Time `json:"client_expires_at,omitempty"`
Health string `json:"health"`
Warning string `json:"warning,omitempty"`
}
LifecycleObservation is the secret-safe, provider-neutral certificate lifecycle state exposed to status/doctor/evidence surfaces.
func InspectLifecycle ¶
func InspectLifecycle(dir string) (LifecycleObservation, error)
InspectLifecycle reads already-materialized lifecycle state. It never issues, renews, revokes or otherwise mutates certificate material.
type NativeTLSFiles ¶ added in v0.4.17
type NativeTLSFiles struct {
Dir string
Material TLSMaterial
}
func EnsureNativeTLS ¶ added in v0.4.17
type Policy ¶
type Policy struct {
Environment string `json:"environment"`
Provider string `json:"provider"`
TLSRequired bool `json:"tls_required"`
AuthenticationRequired bool `json:"authentication_required"`
Authentication AuthenticationMode `json:"authentication"`
PKISource PKISource `json:"pki_source"`
ServerName string `json:"server_name,omitempty"`
ServerCertificate string `json:"server_certificate,omitempty"`
ServerKey string `json:"server_key,omitempty"`
TrustBundle string `json:"trust_bundle,omitempty"`
ClientCertificate string `json:"client_certificate,omitempty"`
ClientKey string `json:"client_key,omitempty"`
IssuerReference string `json:"issuer_reference,omitempty"`
AuthTokenFile string `json:"auth_token_file,omitempty"`
}
type TCPGatewayFiles ¶
type TCPGatewayFiles struct {
Dir string
Config string
PEM string
Material TLSMaterial
}
func EnsureTCPGateway ¶
func EnsureTCPGateway(ctx context.Context, issuer Issuer, policy Policy, providerDir string, spec TCPGatewaySpec) (TCPGatewayFiles, error)
type TCPGatewaySpec ¶
type TLSMaterial ¶
type TLSMaterial struct {
Source PKISource `json:"source"`
CA string `json:"ca"`
ServerCertificate string `json:"server_certificate"`
ServerKey string `json:"server_key"`
ClientCertificate string `json:"client_certificate,omitempty"`
ClientKey string `json:"client_key,omitempty"`
ServerName string `json:"server_name"`
}
func EnsureTLSMaterial ¶
func ExistingTLSMaterial ¶
func ExistingTLSMaterial(policy Policy, dir string) (TLSMaterial, error)
type TrustBundle ¶
Click to show internal directories.
Click to hide internal directories.