interface ISessionCapabilityObject {
    get attenuations(): AttenuationsObject;
    get proofs(): string[];
    get statement(): string;
    addAllCapabilitiesForResource(litResource: ILitResource): void;
    addAttenuation(resource: string, namespace?: string, name?: string, restriction?: {
        [key: string]: PlainJSON;
    }): void;
    addCapabilityForResource(litResource: ILitResource, ability: LitAbility, data?: any): void;
    addProof(proof: string): void;
    addToSiweMessage(siwe: SiweMessage): SiweMessage;
    encodeAsSiweResource(): string;
    verifyCapabilitiesForResource(litResource: ILitResource, ability: LitAbility): boolean;
}

Implemented by

Accessors

Methods

  • Add an arbitrary attenuation to the session capability object.

    Parameters

    • resource: string
    • Optionalnamespace: string
    • Optionalname: string
    • Optionalrestriction: {
          [key: string]: PlainJSON;
      }

    Returns void

    We do NOT recommend using this unless with the LIT specific abilities. Use this ONLY if you know what you are doing.

  • Add a LIT-specific capability to the session capability object for the specified resource.

    Parameters

    • litResource: ILitResource

      The LIT-specific resource being added.

    • ability: LitAbility

      The LIT-specific ability being added.

    • Optionaldata: any

    Returns void

    If the ability is `LitAbility.AccessControlConditionDecryption`,
    then the resource should be the hashed key value of the access control
    condition.
    If the ability is `LitAbility.AccessControlConditionSigning`,
    then the resource should be the hashed key value of the access control
    condition.
    If the ability is `LitAbility.PKPSigning`, then the resource
    should be the PKP token ID.
    If the ability is `LitAbility.RateLimitIncreaseAuth`, then the
    resource should be the RLI token ID.
    If the ability is `LitAbility.LitActionExecution`, then the
    resource should be the Lit Action IPFS CID.

    If the ability is not a LIT-specific ability.

  • Verify that the session capability object has the specified LIT-specific capability for the specified resource.

    Parameters

    Returns boolean