api

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttestedNodeToProto added in v0.11.0

func AttestedNodeToProto(node *common.AttestedNode, selectors []*types.Selector) (*types.Agent, error)

AttestedNodeToProto converts an agent from the given *common.AttestedNode with the provided selectors to *types.Agent

func BundleToProto

func BundleToProto(b *common.Bundle) (*types.Bundle, error)

func CertificatesToProto

func CertificatesToProto(rootCas []*common.Certificate) []*types.X509Certificate

func CreateStatus

func CreateStatus(code codes.Code, format string, a ...interface{}) *types.Status

CreateStatus creates a proto Status

func MakeErr added in v0.11.0

func MakeErr(log logrus.FieldLogger, code codes.Code, msg string, err error) error

MakeErr logs and returns an error composed of: msg, err and code. Errors are treated differently according to its gRPC code.

func MakeStatus added in v0.11.0

func MakeStatus(log logrus.FieldLogger, code codes.Code, msg string, err error) *types.Status

MakeStatus logs and returns a status composed of: msg, err and code. Errors are treated differently according to its gRPC code.

func NodeSelectorsToProto added in v0.11.0

func NodeSelectorsToProto(nodeSelectors *datastore.NodeSelectors) ([]*types.Selector, error)

NodeSelectorsToProto converts node selectors from the given *datastore.NodeSelectors to []*types.Selector

func OK

func OK() *types.Status

OK creates a success proto status

func ParseJWTAuthorities

func ParseJWTAuthorities(keys []*types.JWTKey) ([]*common.PublicKey, error)

func ParseX509Authorities added in v0.11.0

func ParseX509Authorities(certs []*types.X509Certificate) ([]*common.Certificate, error)

func ProtoFromAttestedNode added in v0.11.0

func ProtoFromAttestedNode(n *common.AttestedNode) (*types.Agent, error)

func ProtoFromID

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

ProtoFromID converts a SPIFFE ID from the given spiffeid.ID to types.SPIFFEID

func ProtoFromSelectors added in v0.11.0

func ProtoFromSelectors(in []*common.Selector) []*types.Selector

func ProtoToBundle

func ProtoToBundle(b *types.Bundle) (*common.Bundle, error)

func ProtoToBundleMask added in v0.11.0

func ProtoToBundleMask(mask *types.BundleMask) *common.BundleMask

func ProtoToRegistrationEntry

func ProtoToRegistrationEntry(td spiffeid.TrustDomain, e *types.Entry) (*common.RegistrationEntry, error)

ProtoToRegistrationEntry converts and validate entry into common registration entry

func ProtoToRegistrationEntryWithMask added in v0.11.0

func ProtoToRegistrationEntryWithMask(td spiffeid.TrustDomain, e *types.Entry, mask *types.EntryMask) (*common.RegistrationEntry, error)

ProtoToRegistrationEntryWithMask converts and validate entry into common registration entry, while allowing empty values for SpiffeId, ParentId, and Selectors IF their corresponding values in the mask are false. This allows the user to not specify these fields while updating using a mask. All other fields are allowed to be empty (with or without a mask).

func PublicKeysToProto

func PublicKeysToProto(keys []*common.PublicKey) []*types.JWTKey

func RegistrationEntriesToProto added in v0.11.0

func RegistrationEntriesToProto(es []*common.RegistrationEntry) ([]*types.Entry, error)

RegistrationEntriesToProto converts RegistrationEntry's into Entry's

func RegistrationEntryToProto

func RegistrationEntryToProto(e *common.RegistrationEntry) (*types.Entry, error)

RegistrationEntryToProto converts RegistrationEntry into types Entry

func SelectorsFromProto added in v0.11.0

func SelectorsFromProto(proto []*types.Selector) ([]*common.Selector, error)

SelectorsFromProto converts a slice of types.Selector to a slice of common.Selector

func TrustDomainAgentIDFromProto added in v0.11.0

func TrustDomainAgentIDFromProto(td spiffeid.TrustDomain, protoID *types.SPIFFEID) (spiffeid.ID, error)

func TrustDomainMemberIDFromProto added in v0.11.0

func TrustDomainMemberIDFromProto(td spiffeid.TrustDomain, protoID *types.SPIFFEID) (spiffeid.ID, error)

func TrustDomainWorkloadIDFromProto added in v0.11.0

func TrustDomainWorkloadIDFromProto(td spiffeid.TrustDomain, protoID *types.SPIFFEID) (spiffeid.ID, error)

func VerifyTrustDomainAgentID added in v0.11.0

func VerifyTrustDomainAgentID(td spiffeid.TrustDomain, id spiffeid.ID) error

func VerifyTrustDomainMemberID added in v0.11.0

func VerifyTrustDomainMemberID(td spiffeid.TrustDomain, id spiffeid.ID) error

func VerifyTrustDomainWorkloadID added in v0.11.0

func VerifyTrustDomainWorkloadID(td spiffeid.TrustDomain, id spiffeid.ID) error

Types

type AuthorizedEntryFetcher added in v0.11.0

type AuthorizedEntryFetcher interface {
	// FetchAuthorizedEntries fetches the entries that the specified
	// SPIFFE ID is authorized for
	FetchAuthorizedEntries(ctx context.Context, id spiffeid.ID) ([]*types.Entry, error)
}

AuthorizedEntryFetcher is the interface to fetch authorized entries

type AuthorizedEntryFetcherFunc added in v0.11.0

type AuthorizedEntryFetcherFunc func(ctx context.Context, id spiffeid.ID) ([]*types.Entry, error)

AuthorizedEntryFetcherFunc is an implementation of AuthorizedEntryFetcher using a function.

func (AuthorizedEntryFetcherFunc) FetchAuthorizedEntries added in v0.11.0

func (fn AuthorizedEntryFetcherFunc) FetchAuthorizedEntries(ctx context.Context, id spiffeid.ID) ([]*types.Entry, error)

FetchAuthorizedEntries fetches the entries that the specified SPIFFE ID is authorized for

type CallCounter

type CallCounter interface {
	AddLabel(name, value string)
}

type Names

type Names struct {
	// Service is the service name with the common prefix removed (e.g.,
	// svid.v1.SVID).
	Service string

	// Method is the method name (e.g. MintX509SVID)
	Method string
}

type RateLimiter

type RateLimiter interface {
	RateLimit(ctx context.Context, count int) error
}

type RateLimiterFunc

type RateLimiterFunc func(ctx context.Context, count int) error

func (RateLimiterFunc) RateLimit

func (fn RateLimiterFunc) RateLimit(ctx context.Context, count int) error

Directories

Path Synopsis
agent
v1
bundle
v1
entry
v1
svid
v1

Jump to

Keyboard shortcuts

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