spire

package
v1.15.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"spire-client",
	"Spire Server API Client",
	cell.Config(ClientConfig{}),
	cell.Provide(NewClient),
)

Cell is the cell for the SPIRE client.

View Source
var FakeCellClient = cell.Module(
	"fake-spire-client",
	"Fake Spire Server API Client",
	cell.Config(ClientConfig{}),
	cell.Provide(NewFakeClient),
)

Functions

func NewClient

func NewClient(params params, lc hive.Lifecycle, cfg ClientConfig, log logrus.FieldLogger) identity.Provider

NewClient creates a new SPIRE client. If the mutual authentication is not enabled, it returns a noop client.

func NewFakeClient

func NewFakeClient() identity.Provider

NewFakeClient creates a new fake SPIRE client.

Types

type Client

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

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id string) error

Delete deletes the SPIFFE ID for the given ID. The SPIFFE ID is in the form of spiffe://<trust-domain>/identity/<id>.

func (*Client) List

func (c *Client) List(ctx context.Context) ([]string, error)

func (*Client) Upsert

func (c *Client) Upsert(ctx context.Context, id string) error

Upsert creates or updates the SPIFFE ID for the given ID. The SPIFFE ID is in the form of spiffe://<trust-domain>/identity/<id>.

type ClientConfig

type ClientConfig struct {
	MutualAuthEnabled            bool          `mapstructure:"mesh-auth-mutual-enabled"`
	SpireAgentSocketPath         string        `mapstructure:"mesh-auth-spire-agent-socket"`
	SpireServerAddress           string        `mapstructure:"mesh-auth-spire-server-address"`
	SpireServerConnectionTimeout time.Duration `mapstructure:"mesh-auth-spire-server-connection-timeout"`
	SpiffeTrustDomain            string        `mapstructure:"mesh-auth-spiffe-trust-domain"`
}

ClientConfig contains the configuration for the SPIRE client.

func (ClientConfig) Flags

func (cfg ClientConfig) Flags(flags *pflag.FlagSet)

Flags adds the flags used by ClientConfig.

Jump to

Keyboard shortcuts

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