bundle

package
v0.1.1 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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FormatMap = map[string]inspect.Formatter[*jose.JSONWebKeySet, BundleOutputOptions]{
	"json":    {Label: "JSON", Lexer: "json", Converter: ConvertBundleToJson},
	"yaml":    {Label: "YAML", Lexer: "yaml", Converter: ConvertBundleToYaml},
	"summary": {Label: "Summary", Lexer: "text", Converter: ConvertBundleToSummary},
	"key-ids": {Label: "Key IDs", Lexer: "text", Converter: ConvertBundleToKeyIDs},
}

These functions assume that the inspector has already checked that the JWKS has at least one key.

Functions

func ConvertBundleToJson

func ConvertBundleToJson(jwks *jose.JSONWebKeySet, options BundleOutputOptions) (string, error)

func ConvertBundleToKeyIDs

func ConvertBundleToKeyIDs(jwks *jose.JSONWebKeySet, options BundleOutputOptions) (string, error)

func ConvertBundleToSummary

func ConvertBundleToSummary(jwks *jose.JSONWebKeySet, options BundleOutputOptions) (string, error)

func ConvertBundleToYaml

func ConvertBundleToYaml(jwks *jose.JSONWebKeySet, options BundleOutputOptions) (string, error)

Types

type Bundle

type Bundle interface {
	Marshal() ([]byte, error)
}

type BundleClient

type BundleClient struct {
	WorkloadAPISocket string
	Filename          string
	TrustDomain       string
}

func (*BundleClient) GetJWTBundle

func (c *BundleClient) GetJWTBundle(ctx context.Context) error

func (*BundleClient) GetX509Bundle

func (c *BundleClient) GetX509Bundle(ctx context.Context) error

type BundleInspector

type BundleInspector struct {
	Location      string
	OutputFormat  string
	OutputOptions BundleOutputOptions
}

func (*BundleInspector) Inspect

func (i *BundleInspector) Inspect() (string, error)

type BundleOutputOptions

type BundleOutputOptions struct {
	Indent     bool
	Color      bool
	KeyIdsOnly bool
	Keys       bool
}

func (*BundleOutputOptions) InColor

func (o *BundleOutputOptions) InColor() bool

type JwkSource

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

A JwkSource is a JWK read from either a file or a URL

func NewJwkSource

func NewJwkSource(path string) (*JwkSource, error)

Returns a new JwkSource given either a URL or a file path. We first test if it's a URL, and ensure it starts with http(s). This function will normalize and validate the path, but not test for existence or network reachability.

func (*JwkSource) GetJWTBundleForTrustDomain

func (jwk *JwkSource) GetJWTBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*jwtbundle.Bundle, error)

GetJWTBundleForTrustDomain returns the JWT bundle for the given trust domain. It implements the Source interface. Since we're reading from a JWK, the trust domain is ignored.

func (*JwkSource) ParseKeys

func (jwk *JwkSource) ParseKeys() (*jose.JSONWebKeySet, error)

Jump to

Keyboard shortcuts

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