Documentation
¶
Overview ¶
Package identity implements Canton identity operations such as party management and fingerprint-to-party mapping.
Index ¶
- func RecordValue(fields ...*lapiv2.Value) *lapiv2.Value
- type Client
- func (c *Client) AllocateExternalParty(ctx context.Context, hint string, spkiPublicKey []byte, ...) (*Party, error)
- func (c *Client) AllocateExternalPartyWithSignature(ctx context.Context, topology *ExternalPartyTopology, derSignature []byte) (*Party, error)
- func (c *Client) AllocateParty(ctx context.Context, hint string) (*Party, error)
- func (c *Client) CreateFingerprintMapping(ctx context.Context, req CreateFingerprintMappingRequest) (*FingerprintMapping, error)
- func (c *Client) GenerateExternalPartyTopology(ctx context.Context, hint string, spkiPublicKey []byte) (*ExternalPartyTopology, error)
- func (c *Client) GetFingerprintMapping(ctx context.Context, fingerprint string) (*FingerprintMapping, error)
- func (c *Client) GetParticipantID(ctx context.Context) (string, error)
- func (c *Client) GrantActAsParty(ctx context.Context, partyID string) error
- func (c *Client) ListParties(ctx context.Context) ([]*Party, error)
- func (c *Client) PackageID() string
- type Config
- type CreateFingerprintMappingRequest
- type ExternalPartyKey
- type ExternalPartyTopology
- type FingerprintMapping
- type Identity
- type Option
- type Party
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the Identity interface.
func (*Client) AllocateExternalParty ¶
func (c *Client) AllocateExternalParty(ctx context.Context, hint string, spkiPublicKey []byte, signer ExternalPartyKey) (*Party, error)
AllocateExternalParty creates an external party using the Interactive Submission flow. External parties have no practical limit (unlike internal parties which are capped at ~200). spkiPublicKey is the DER-encoded X.509 SubjectPublicKeyInfo public key (use CantonKeyPair.SPKIPublicKey()). signer provides the SignDER capability for signing the topology multi-hash.
func (*Client) AllocateExternalPartyWithSignature ¶
func (*Client) AllocateParty ¶
func (*Client) CreateFingerprintMapping ¶
func (c *Client) CreateFingerprintMapping(ctx context.Context, req CreateFingerprintMappingRequest) (*FingerprintMapping, error)
func (*Client) GenerateExternalPartyTopology ¶
func (*Client) GetFingerprintMapping ¶
func (*Client) GetParticipantID ¶
func (*Client) GrantActAsParty ¶
type Config ¶
type Config struct {
DomainID string `yaml:"domain_id"`
IssuerParty string `yaml:"issuer_party"`
UserID string `yaml:"user_id"`
PackageID string `yaml:"package_id" validate:"required"` // package ID for FingerprintMapping (Common.FingerprintAuth)
}
Config contains the configuration required to initialize the identity client.
type CreateFingerprintMappingRequest ¶
type CreateFingerprintMappingRequest struct {
UserParty string
Fingerprint string
EvmAddress string
}
CreateFingerprintMappingRequest contains inputs for creating a FingerprintMapping.
type ExternalPartyKey ¶
ExternalPartyKey holds the signing capability needed to allocate an external party. Canton returns a multihash that must be SHA-256 hashed and signed. Implemented by keys.CantonKeyPair.
type ExternalPartyTopology ¶
type ExternalPartyTopology struct {
TopologyTransactions [][]byte // Serialized topology transactions
MultiHash []byte // Hash to be signed by the party's key
Fingerprint string // Canton key fingerprint (multihash of SPKI public key)
}
ExternalPartyTopology holds the intermediate state from GenerateExternalPartyTopology needed to complete external party allocation with a client-provided signature.
type FingerprintMapping ¶
type FingerprintMapping struct {
ContractID string
Issuer string
UserParty string
Fingerprint string
EvmAddress string
}
FingerprintMapping represents a FingerprintMapping contract.
type Identity ¶
type Identity interface {
AllocateParty(ctx context.Context, hint string) (*Party, error)
AllocateExternalParty(ctx context.Context, hint string, spkiPublicKey []byte, signer ExternalPartyKey) (*Party, error)
ListParties(ctx context.Context) ([]*Party, error) // TODO: add iterator
GetParticipantID(ctx context.Context) (string, error)
CreateFingerprintMapping(ctx context.Context, req CreateFingerprintMappingRequest) (*FingerprintMapping, error)
GetFingerprintMapping(ctx context.Context, fingerprint string) (*FingerprintMapping, error)
GrantActAsParty(ctx context.Context, partyID string) error
// GenerateExternalPartyTopology generates the topology transactions and multi-hash
// needed for external party allocation. The multi-hash must be signed by the party's
// private key and submitted via AllocateExternalPartyWithSignature.
GenerateExternalPartyTopology(ctx context.Context, hint string, spkiPublicKey []byte) (*ExternalPartyTopology, error)
// AllocateExternalPartyWithSignature completes external party allocation using
// a client-provided DER signature of the topology multi-hash.
AllocateExternalPartyWithSignature(ctx context.Context, topology *ExternalPartyTopology, derSignature []byte) (*Party, error)
// PackageID returns the DAML package ID this client uses for identity templates
// (e.g. Common.FingerprintAuth). Callers that need to query identity templates
// using a ledger client directly (rather than through this client) can use this
// to construct the correct template identifier.
PackageID() string
}
Identity defines identity and party management operations.
type Option ¶
type Option func(*settings)
Option configures the identity client.
func WithLogger ¶
WithLogger sets a custom logger for the identity client.