Documentation
¶
Index ¶
- Constants
- Variables
- type AuditInfo
- type AuditInfoDeserializer
- type BinderService
- type Config
- type ConfiguredIdentity
- type Deserializer
- type DeserializerManager
- type Identity
- type IdentityConfiguration
- type IdentityConfigurationIterator
- type IdentityInfo
- type IdentityProvider
- type IdentityRoleType
- type IdentityStoreService
- type Iterator
- type Keystore
- type NetworkBinderService
- type Role
- type SigService
- type StorageProvider
- type WalletID
- type WalletLookupID
- type WalletStoreService
Constants ¶
View Source
const ( // IssuerRole is the role of an issuer IssuerRole = iota // AuditorRole is the role of an auditor AuditorRole // OwnerRole is the role of an owner OwnerRole // CertifierRole is the role of a certifier CertifierRole )
Variables ¶
View Source
var ( IdentityRoleStrings = map[IdentityRoleType]string{ IssuerRole: "issuer", AuditorRole: "auditor", OwnerRole: "owner", CertifierRole: "certifier", } )
Functions ¶
This section is empty.
Types ¶
type AuditInfoDeserializer ¶
type BinderService ¶
type Config ¶
type Config interface { // CacheSizeForOwnerID returns the cache size to be used for the given owner wallet. // If not defined, the function returns -1 CacheSizeForOwnerID(id string) int TranslatePath(path string) string IdentitiesForRole(role IdentityRoleType) ([]*ConfiguredIdentity, error) }
type ConfiguredIdentity ¶ added in v0.5.0
type ConfiguredIdentity struct { ID string `yaml:"id"` Default bool `yaml:"default,omitempty"` Path string `yaml:"path"` CacheSize int `yaml:"cacheSize"` Type string `yaml:"type,omitempty"` Opts interface{} `yaml:"opts,omitempty"` }
func (*ConfiguredIdentity) String ¶ added in v0.5.0
func (i *ConfiguredIdentity) String() string
type Deserializer ¶
type DeserializerManager ¶
type DeserializerManager interface { AddDeserializer(deserializer Deserializer) DeserializeSigner(raw []byte) (tdriver.Signer, error) }
type IdentityConfiguration ¶ added in v0.5.0
type IdentityConfiguration = driver.IdentityConfiguration
type IdentityConfigurationIterator ¶ added in v0.5.0
type IdentityConfigurationIterator = Iterator[IdentityConfiguration]
type IdentityInfo ¶ added in v0.5.0
type IdentityInfo interface { // ID returns the identifier of the Identity ID() string // EnrollmentID returns the enrollment ID of the Identity EnrollmentID() string // Remote is true if this identity info refers to an identify whose corresponding secret key is not known, it is external/remote Remote() bool // Get returns the identity and it is audit info. // Get might return a different identity at each call depending on the implementation. Get(ctx context.Context) (Identity, []byte, error) // Anonymous is true if this identity supports anonymity Anonymous() bool }
IdentityInfo models a long-term identity inside the Identity Provider. An identity has an identifier (ID) and an Enrollment ID, unique identifier. An identity can be remote, meaning that the corresponding secret key is remotely available.
type IdentityProvider ¶
type IdentityProvider interface { // RegisterAuditInfo binds the passed audit info to the passed identity RegisterAuditInfo(ctx context.Context, identity driver.Identity, info []byte) error // GetAuditInfo returns the audit info associated to the passed identity, nil if not found GetAuditInfo(ctx context.Context, identity driver.Identity) ([]byte, error) }
type IdentityRoleType ¶ added in v0.5.0
type IdentityRoleType int
IdentityRoleType is the role of an identity
type IdentityStoreService ¶ added in v0.5.0
type IdentityStoreService interface { // AddConfiguration stores an identity and the path to the credentials relevant to this identity AddConfiguration(ctx context.Context, wp IdentityConfiguration) error // ConfigurationExists returns true if a configuration with the given id and type exists. ConfigurationExists(ctx context.Context, id, typ, url string) (bool, error) // IteratorConfigurations returns an iterator to all configurations stored IteratorConfigurations(ctx context.Context, configurationType string) (IdentityConfigurationIterator, error) // StoreIdentityData stores the passed identity and token information StoreIdentityData(ctx context.Context, id []byte, identityAudit []byte, tokenMetadata []byte, tokenMetadataAudit []byte) error // GetAuditInfo retrieves the audit info bounded to the given identity GetAuditInfo(ctx context.Context, id []byte) ([]byte, error) // GetTokenInfo returns the token information related to the passed identity GetTokenInfo(ctx context.Context, id []byte) ([]byte, []byte, error) // StoreSignerInfo stores the passed signer info and bound it to the given identity StoreSignerInfo(ctx context.Context, id, info []byte) error // GetExistingSignerInfo returns the hashes of the identities for which StoreSignerInfo was called GetExistingSignerInfo(ctx context.Context, ids ...driver.Identity) ([]string, error) // SignerInfoExists returns true if StoreSignerInfo was called on input the given identity SignerInfoExists(ctx context.Context, id []byte) (bool, error) // GetSignerInfo returns the signer info bound to the given identity GetSignerInfo(ctx context.Context, id []byte) ([]byte, error) // Close closes the store Close() error }
type NetworkBinderService ¶
type Role ¶ added in v0.5.0
type Role interface { // ID returns the identifier of this role ID() IdentityRoleType // MapToIdentity returns the long-term identity and its identifier for the given index. // The index can be an identity or a label (string). MapToIdentity(ctx context.Context, v WalletLookupID) (Identity, string, error) // GetIdentityInfo returns the long-term identity info associated to the passed id GetIdentityInfo(ctx context.Context, id string) (IdentityInfo, error) // RegisterIdentity registers the given identity RegisterIdentity(ctx context.Context, config IdentityConfiguration) error // IdentityIDs returns the identifiers contained in this role IdentityIDs() ([]string, error) }
Role is a container of long-term identities. A long-term identity is then used to construct a wallet.
type SigService ¶
type StorageProvider ¶ added in v0.5.0
type StorageProvider interface { WalletStore(tmsID token.TMSID) (WalletStoreService, error) IdentityStore(tmsID token.TMSID) (IdentityStoreService, error) Keystore() (Keystore, error) }
type WalletLookupID ¶ added in v0.5.0
type WalletLookupID = driver.WalletLookupID
WalletLookupID defines the type of identifiers that can be used to retrieve a given wallet. It can be a string, as the name of the wallet, or an identity contained in that wallet. Ultimately, it is the token driver to decide which types are allowed.
type WalletStoreService ¶ added in v0.5.0
type WalletStoreService interface { // GetWalletID fetches a walletID that is bound to the identity passed GetWalletID(ctx context.Context, identity token.Identity, roleID int) (WalletID, error) // GetWalletIDs fetches all walletID's that have been stored so far without duplicates GetWalletIDs(ctx context.Context, roleID int) ([]WalletID, error) // StoreIdentity binds an identity to a walletID and its metadata StoreIdentity(ctx context.Context, identity token.Identity, eID string, wID WalletID, roleID int, meta []byte) error // IdentityExists checks whether an identity-wallet binding has already been stored IdentityExists(ctx context.Context, identity token.Identity, wID WalletID, roleID int) bool // LoadMeta returns the metadata stored for a specific identity LoadMeta(ctx context.Context, identity token.Identity, wID WalletID, roleID int) ([]byte, error) // Close closes the store Close() error }
Click to show internal directories.
Click to hide internal directories.