membership

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPriority = -1 // smaller numbers, higher priority
)

Variables

View Source
var PriorityComparison = func(a, b LocalIdentityWithPriority) int {
	if a.Priority < b.Priority {
		return -1
	} else if a.Priority > b.Priority {
		return 1
	}
	return 0
}

PriorityComparison gives higher priority to smaller numbers

Functions

This section is empty.

Types

type GetIdentityFunc

type GetIdentityFunc func(ctx context.Context, auditInfo []byte) (driver.Identity, []byte, error)

GetIdentityFunc is a function that returns an Identity and its associated audit info for the given options

type IdentityInfo

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

IdentityInfo implements the driver.IdentityInfo interface on top LocalIdentity

func NewIdentityInfo

func NewIdentityInfo(localIdentity *LocalIdentity, getIdentity func(ctx context.Context) (driver.Identity, []byte, error)) *IdentityInfo

func (*IdentityInfo) Anonymous

func (i *IdentityInfo) Anonymous() bool

func (*IdentityInfo) EnrollmentID

func (i *IdentityInfo) EnrollmentID() string

func (*IdentityInfo) Get

func (*IdentityInfo) ID

func (i *IdentityInfo) ID() string

func (*IdentityInfo) Remote

func (i *IdentityInfo) Remote() bool

type KeyManager

type KeyManager interface {
	idriver.Deserializer
	EnrollmentID() string
	IsRemote() bool
	Anonymous() bool
	IdentityType() identity.Type
	Identity(ctx context.Context, auditInfo []byte) (driver.Identity, []byte, error)
}

type KeyManagerProvider

type KeyManagerProvider interface {
	Get(identityConfig *driver.IdentityConfiguration) (KeyManager, error)
}

type LocalIdentity

type LocalIdentity struct {
	Name         string
	EnrollmentID string
	Default      bool
	Anonymous    bool
	GetIdentity  GetIdentityFunc
	Remote       bool
}

LocalIdentity contains information about an identity

func (*LocalIdentity) String

func (i *LocalIdentity) String() string

type LocalIdentityWithPriority

type LocalIdentityWithPriority struct {
	Identity *LocalIdentity
	Priority int
}

type LocalMembership

type LocalMembership struct {
	KeyManagerProviders []KeyManagerProvider
	IdentityType        string
	IdentityProvider    idriver.IdentityProvider

	DefaultAnonymous bool
	// contains filtered or unexported fields
}

func NewLocalMembership

func NewLocalMembership(
	logger logging.Logger,
	config idriver.Config,
	defaultNetworkIdentity driver.Identity,
	signerService idriver.SigService,
	deserializerManager idriver.DeserializerManager,
	identityDB idriver.IdentityStoreService,
	binderService idriver.BinderService,
	identityType string,
	defaultAnonymous bool,
	identityProvider idriver.IdentityProvider,
	keyManagerProviders ...KeyManagerProvider,
) *LocalMembership

func (*LocalMembership) DefaultNetworkIdentity

func (l *LocalMembership) DefaultNetworkIdentity() driver.Identity

func (*LocalMembership) GetDefaultIdentifier

func (l *LocalMembership) GetDefaultIdentifier() string

func (*LocalMembership) GetIdentifier

func (l *LocalMembership) GetIdentifier(id driver.Identity) (string, error)

func (*LocalMembership) GetIdentityInfo

func (l *LocalMembership) GetIdentityInfo(label string, auditInfo []byte) (idriver.IdentityInfo, error)

func (*LocalMembership) IDs

func (l *LocalMembership) IDs() ([]string, error)

func (*LocalMembership) IsMe

func (*LocalMembership) Load

func (l *LocalMembership) Load(identities []*idriver.ConfiguredIdentity, targets []view.Identity) error

func (*LocalMembership) RegisterIdentity

func (l *LocalMembership) RegisterIdentity(ctx context.Context, idConfig driver.IdentityConfiguration) error

type TypedIdentityInfo

type TypedIdentityInfo struct {
	GetIdentity  func(context.Context, []byte) (driver.Identity, []byte, error)
	IdentityType identity.Type

	EnrollmentID     string
	RootIdentity     driver.Identity
	IdentityProvider idriver.IdentityProvider
	BinderService    idriver.BinderService
}

func (*TypedIdentityInfo) Get

func (i *TypedIdentityInfo) Get(ctx context.Context, auditInfo []byte) (driver.Identity, []byte, error)

Jump to

Keyboard shortcuts

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