Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { // ID is the Agent's SPIFFE ID. ID spiffeid.ID // Selectors is the Agent's selectors. Selectors []*types.Selector }
Agent represents the association of selectors to an agent SPIFFE ID.
type AgentIterator ¶
type AgentIterator interface { // Next returns true if there are any remaining agents in the data source and returns false otherwise. Next(ctx context.Context) bool // Agent returns the next agent from the data source. Agent() Agent // Err returns an error encountered when attempting to process agents from the data source. Err() error }
AgentIterator is used to iterate through Agent selectors from a data source. The usage pattern of the iterator is as follows:
for it.Next() { agent := it.Agent() // process agent } if it.Err() { // handle error }
type Cache ¶
Cache contains a snapshot of all registration entries and Agent selectors from the data source at a particular moment in time.
type EntryIterator ¶
type EntryIterator interface { // Next returns true if there are any remaining registration entries in the data source and returns false otherwise. Next(ctx context.Context) bool // Entry returns the next entry from the data source. Entry() *types.Entry // Err returns an error encountered when attempting to process entries from the data source. Err() error }
EntryIterator is used to iterate through registration entries from a data source. The usage pattern of the iterator is as follows:
for it.Next() { entry := it.Entry() // process entry } if it.Err() { // handle error }
type FullEntryCache ¶
type FullEntryCache struct {
// contains filtered or unexported fields
}
func Build ¶
func Build(ctx context.Context, entryIter EntryIterator, agentIter AgentIterator) (*FullEntryCache, error)
Build queries the data source for all registration entries and Agent selectors and builds an in-memory representation of the data that can be used for efficient lookups.
func BuildFromDataStore ¶
BuildFromDataStore builds a Cache using the provided datastore as the data source
func (*FullEntryCache) GetAuthorizedEntries ¶
func (c *FullEntryCache) GetAuthorizedEntries(agentID spiffeid.ID) []*types.Entry
GetAuthorizedEntries gets all authorized registration entries for a given Agent SPIFFE ID.