common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousRole

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

AnonymousRole models a role whose identities are anonymous

func NewAnonymousRole

func NewAnonymousRole(logger logging.Logger, roleID driver.IdentityRole, networkID string, nodeIdentity driver.Identity, localMembership localMembership) *AnonymousRole

func (*AnonymousRole) GetIdentityInfo

func (r *AnonymousRole) GetIdentityInfo(id string) (driver.IdentityInfo, error)

GetIdentityInfo returns the identity information for the given identity identifier

func (*AnonymousRole) ID

func (*AnonymousRole) IdentityIDs

func (r *AnonymousRole) IdentityIDs() ([]string, error)

func (*AnonymousRole) MapToID

MapToID returns the identity for the given argument

func (*AnonymousRole) RegisterIdentity

func (r *AnonymousRole) RegisterIdentity(config driver.IdentityConfiguration) error

RegisterIdentity registers the given identity

type GetIdentityFunc

type GetIdentityFunc func(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() (driver.Identity, []byte, error)) *IdentityInfo

func (*IdentityInfo) EnrollmentID

func (i *IdentityInfo) EnrollmentID() string

func (*IdentityInfo) Get

func (i *IdentityInfo) Get() (driver.Identity, []byte, error)

func (*IdentityInfo) ID

func (i *IdentityInfo) ID() string

func (*IdentityInfo) Remote

func (i *IdentityInfo) Remote() bool

type KeyManager

type KeyManager interface {
	driver2.Deserializer
	EnrollmentID() string
	IsRemote() bool
	Anonymous() bool
	Identity([]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
	GetIdentity  GetIdentityFunc
	Remote       bool
}

LocalIdentity contains information about an identity

type LocalMembership

type LocalMembership struct {
	KeyManagerProvider KeyManagerProvider
	IdentityType       string
	// contains filtered or unexported fields
}

func NewLocalMembership

func NewLocalMembership(
	logger logging.Logger,
	config driver2.Config,
	defaultNetworkIdentity driver.Identity,
	signerService driver2.SigService,
	deserializerManager driver2.DeserializerManager,
	identityDB driver3.IdentityDB,
	binderService driver2.BinderService,
	identityType string,
	KeyManagerProvider 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) (driver.IdentityInfo, error)

func (*LocalMembership) IDs

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

func (*LocalMembership) IsMe

func (l *LocalMembership) IsMe(id driver.Identity) bool

func (*LocalMembership) Load

func (l *LocalMembership) Load(identities []*config.Identity) error

func (*LocalMembership) RegisterIdentity

func (l *LocalMembership) RegisterIdentity(idConfig driver.IdentityConfiguration) error

type LongTermRole

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

LongTermRole models a role whose identities are not anonymous

func NewLongTermRole

func NewLongTermRole(logger logging.Logger, roleID driver.IdentityRole, networkID string, nodeIdentity driver.Identity, localMembership localMembership) *LongTermRole

func (*LongTermRole) GetIdentityInfo

func (r *LongTermRole) GetIdentityInfo(id string) (driver.IdentityInfo, error)

GetIdentityInfo returns the identity information for the given identity identifier

func (*LongTermRole) ID

func (*LongTermRole) IdentityIDs

func (r *LongTermRole) IdentityIDs() ([]string, error)

func (*LongTermRole) MapToID

MapToID returns the identity for the given argument

func (*LongTermRole) RegisterIdentity

func (r *LongTermRole) RegisterIdentity(config driver.IdentityConfiguration) error

RegisterIdentity registers the given identity

Jump to

Keyboard shortcuts

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