Documentation
¶
Overview ¶
Package spiffe adapts the SPIFFE Workload API to credentiallease identities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient contains a redirect-disabled HTTP client and the X.509 source it uses. The transport does not honor HTTP proxy environment variables because proxying would cross the configured SPIFFE peer-authentication boundary.
func NewHTTPClient ¶
func NewHTTPClientWithTimeout ¶
func NewHTTPClientWithTimeout(ctx context.Context, socket string, allowedServerIDs []string, timeout time.Duration) (*HTTPClient, error)
NewHTTPClientWithTimeout creates the same redirect-disabled, proxy-free SPIFFE mTLS client as NewHTTPClient with an explicit total and response header timeout. The upper bound prevents callers from creating unbounded requests while allowing control-plane calls with bounded evidence checks.
func (*HTTPClient) Close ¶
func (c *HTTPClient) Close() error
func (*HTTPClient) CloseIdleConnections ¶
func (c *HTTPClient) CloseIdleConnections()
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source obtains short-lived JWT-SVIDs for one requested audience. It must be closed when the owning service shuts down.
type X509Identity ¶
type X509Identity struct {
// contains filtered or unexported fields
}
X509Identity owns a rotating X.509-SVID source used to build mutually authenticated TLS configurations. Close it when the process shuts down.
func NewX509Identity ¶
func NewX509Identity(ctx context.Context, socket string) (*X509Identity, error)
NewX509Identity connects to the local Unix Workload API and waits for the first SVID and trust bundle. It never accepts a remote TCP endpoint.
func (*X509Identity) ClientTLSConfig ¶
func (i *X509Identity) ClientTLSConfig(allowedServerIDs []string) (*tls.Config, error)
ClientTLSConfig presents this workload's SVID and authorizes only the configured server identities.
func (*X509Identity) Close ¶
func (i *X509Identity) Close() error
func (*X509Identity) ServerTLSConfig ¶
func (i *X509Identity) ServerTLSConfig(allowedClientIDs []string) (*tls.Config, error)
ServerTLSConfig presents this workload's SVID and requires clients to prove one of the exact configured SPIFFE identities.