AttributesIdentity
Defined in: packages/core/src/identity/identity/attributes.ts:50
An Identity decorator that injects sender_info into the request body
before delegating to an inner identity for signing.
Because sender_info is part of the request content, it is included in the
representation-independent hash (requestIdOf) and covered by the sender’s
signature.
Example
Section titled “Example”const inner = DelegationIdentity.fromDelegation(key, chain);const identity = new AttributesIdentity({ inner, attributes: { data: new Uint8Array([...]), signature: new Uint8Array([...]) }, signer: { canisterId: Principal.fromText('aaaaa-aa') },});const agent = HttpAgent.create({ identity });Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttributesIdentity(
options):AttributesIdentity
Defined in: packages/core/src/identity/identity/attributes.ts:61
Parameters
Section titled “Parameters”options
Section titled “options”Configuration for the identity.
Returns
Section titled “Returns”AttributesIdentity
Methods
Section titled “Methods”getPrincipal()
Section titled “getPrincipal()”getPrincipal():
Principal
Defined in: packages/core/src/identity/identity/attributes.ts:67
Get the principal represented by this identity. Normally should be a
Principal.selfAuthenticating().
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”transformRequest()
Section titled “transformRequest()”transformRequest(
request):Promise<unknown>
Defined in: packages/core/src/identity/identity/attributes.ts:71
Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<unknown>