wlapi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultX509AuthorityTTL = time.Hour * 24
	DefaultJWTAuthorityTTL  = time.Hour * 24

	DefaultWorkloadX509SVIDTTL      = time.Hour
	DefaultWorkloadX509SVIDRotateAt = time.Minute * 10

	DefaultWorkloadJWTSVIDTTL = time.Hour
)

Variables

This section is empty.

Functions

func DERFromCertificates

func DERFromCertificates(certs []*x509.Certificate) (derBytes []byte)

func Run

func Run(ctx context.Context, config Config) error

Types

type Config

type Config struct {
	TrustDomains []TrustDomainConfig
	Federation   FederationConfig
}

func LoadConfig

func LoadConfig(configPath string) (Config, error)

type FederationConfig

type FederationConfig struct {
	Port int
}

type JWTAuthority

type JWTAuthority interface {
	MintJWTSVID(id spiffeid.ID, audience []string, ttl time.Duration) (string, error)
	JWTBundles() (map[string][]byte, error)
}

type TrustDomain

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

func NewTrustDomain

func NewTrustDomain(config TrustDomainConfig) (*TrustDomain, error)

func (*TrustDomain) Bundle

func (td *TrustDomain) Bundle() (*spiffebundle.Bundle, error)

func (*TrustDomain) JWTBundles

func (td *TrustDomain) JWTBundles() (map[string][]byte, error)

func (*TrustDomain) MintJWTSVID

func (td *TrustDomain) MintJWTSVID(id spiffeid.ID, audience []string, ttl time.Duration) (string, error)

func (*TrustDomain) MintX509SVID

func (td *TrustDomain) MintX509SVID(id spiffeid.ID, publicKey crypto.PublicKey, ttl time.Duration) (*x509.Certificate, []*x509.Certificate, error)

func (*TrustDomain) Name

func (td *TrustDomain) Name() string

func (*TrustDomain) Run

func (td *TrustDomain) Run(ctx context.Context) (err error)

func (*TrustDomain) X509Bundles

func (td *TrustDomain) X509Bundles() (map[string][]byte, error)

type TrustDomainConfig

type TrustDomainConfig struct {
	Name spiffeid.TrustDomain

	X509AuthorityTTL time.Duration
	JWTAuthorityTTL  time.Duration

	Workloads []WorkloadConfig
}

type Workload

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

func NewWorkload

func NewWorkload(x509Authority X509Authority, jwtAuthority JWTAuthority, config WorkloadConfig) (*Workload, error)

func (*Workload) Run

func (wl *Workload) Run(ctx context.Context) error

type WorkloadConfig

type WorkloadConfig struct {
	ID         spiffeid.ID
	SocketPath string

	X509SVIDTTL      time.Duration
	X509SVIDRotateAt time.Duration

	JWTSVIDTTL time.Duration
}

type X509Authority

type X509Authority interface {
	MintX509SVID(id spiffeid.ID, publicKey crypto.PublicKey, ttl time.Duration) (*x509.Certificate, []*x509.Certificate, error)
	X509Bundles() (map[string][]byte, error)
}

Jump to

Keyboard shortcuts

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