Skip to main content

Capability

@iota/audit-trails API documentation


Class: Capability

Capability data describing a granted role and its validity window.

Remarks​

A capability grants exactly one role against exactly one trail and may additionally restrict who may use it and during which time window it is valid.

Properties​

id​

id: string

Capability object ID.


role​

role: string

Role granted by the capability.


targetKey​

targetKey: string

Trail object ID protected by the capability.

Accessors​

issuedTo​

Get Signature​

get issuedTo(): string | undefined

Address bound to the capability. When null, any holder may present the capability for authorization.

Returns​

string | undefined

Set Signature​

set issuedTo(value): void

Address bound to the capability. When null, any holder may present the capability for authorization.

Parameters​
value​

string | null | undefined

Returns​

void


validFrom​

Get Signature​

get validFrom(): bigint | undefined

Earliest millisecond timestamp (since the Unix epoch, inclusive) at which the capability is valid. When null, the capability is valid from its creation time.

Returns​

bigint | undefined

Set Signature​

set validFrom(value): void

Earliest millisecond timestamp (since the Unix epoch, inclusive) at which the capability is valid. When null, the capability is valid from its creation time.

Parameters​
value​

bigint | null | undefined

Returns​

void


validUntil​

Get Signature​

get validUntil(): bigint | undefined

Latest millisecond timestamp (since the Unix epoch, inclusive) at which the capability is still valid. When null, the capability does not expire.

Returns​

bigint | undefined

Set Signature​

set validUntil(value): void

Latest millisecond timestamp (since the Unix epoch, inclusive) at which the capability is still valid. When null, the capability does not expire.

Parameters​
value​

bigint | null | undefined

Returns​

void

Methods​

toJSON()​

toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object


toString()​

toString(): string

Return stringified version of self.

Returns​

string