idutil

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ServerIDPath = "/spire/server"
)

Variables

This section is empty.

Functions

func AgentID

func AgentID(td spiffeid.TrustDomain, suffix string) (spiffeid.ID, error)

AgentID creates an agent SPIFFE ID given a trust domain and a path suffix. The path suffix must be an absolute path. The /spire/agent prefix is prefixed to the suffix to form the path.

func IDFromProto added in v0.11.3

func IDFromProto(id *types.SPIFFEID) (spiffeid.ID, error)

IDFromProto returns SPIFFE ID from the proto representation

func IDProtoFromString added in v0.11.3

func IDProtoFromString(s string) (*types.SPIFFEID, error)

IDProtoFromString parses a SPIFFE ID string into the raw ID proto components. It does not attempt to escape/unescape any portion of the ID.

func IDProtoString added in v0.11.3

func IDProtoString(id *types.SPIFFEID) (string, error)

IDProtoString constructs a SPIFFE ID string for the given ID protobuf.

func IsAgentPath added in v0.11.0

func IsAgentPath(path string) bool

IsAgentPath returns true if the given string is an SPIRE agent ID path. SPIRE agent IDs are prefixed with "/spire/agent/".

func IsAgentPathForNodeAttestor added in v1.2.1

func IsAgentPathForNodeAttestor(path string, nodeAttestor string) bool

IsAgentPathForNodeAttestor returns if the path lives under the agent namesepace for the given node attestor

func IsReservedPath added in v0.11.0

func IsReservedPath(path string) bool

func MemberFromString added in v1.2.0

func MemberFromString(td spiffeid.TrustDomain, s string) (spiffeid.ID, error)

func RequireAgentID added in v1.2.0

func RequireAgentID(td spiffeid.TrustDomain, suffix string) spiffeid.ID

RequireAgentID creates an agent SPIFFE ID given a trust domain and a path suffix. The path suffix must be an absolute path. The /spire/agent prefix is prefixed to the suffix to form the path. It panics if the given trust domain isn't valid.

func RequireIDFromProto added in v1.2.0

func RequireIDFromProto(id *types.SPIFFEID) spiffeid.ID

RequireIDFromProto returns a SPIFFE ID from the proto representation. It panics if the proto is not well formed.

func RequireIDProtoString added in v1.2.0

func RequireIDProtoString(id *types.SPIFFEID) string

RequireIDProtoString constructs a SPIFFE ID string for the given ID proto. It panics if the proto is not well formed.

func RequireServerID added in v1.2.0

func RequireServerID(td spiffeid.TrustDomain) spiffeid.ID

RequireServerID returns the server SPIFFE ID for the given trust domain. It panics if the given trust domain isn't valid.

func ServerID

func ServerID(td spiffeid.TrustDomain) (spiffeid.ID, error)

ServerID creates a server SPIFFE ID string given a trust domain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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