From c06a9293892a67515f9439d169f5a0605aa3c378 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Thu, 26 Sep 2024 12:13:24 -0400 Subject: [PATCH] added comments to the Identity and Did Api classes, will expand on DID in subsequent PR --- packages/agent/src/did-api.ts | 6 ++++++ packages/agent/src/identity-api.ts | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/agent/src/did-api.ts b/packages/agent/src/did-api.ts index 7c7ae7069..91abb5807 100644 --- a/packages/agent/src/did-api.ts +++ b/packages/agent/src/did-api.ts @@ -103,6 +103,12 @@ export function isDidRequest( return didRequest.messageType === messageType; } +/** + * This API is used to manage and interact with DIDs within the Web5 Agent framework. + * + * If a DWN Data Store is used, the DID information is stored under DID's own tenant by default. + * If a tenant property is passed, that tenant will be used to store the DID information. + */ export class AgentDidApi extends UniversalResolver { /** * Holds the instance of a `Web5PlatformAgent` that represents the current execution context for diff --git a/packages/agent/src/identity-api.ts b/packages/agent/src/identity-api.ts index 1834211e2..113f35e9c 100644 --- a/packages/agent/src/identity-api.ts +++ b/packages/agent/src/identity-api.ts @@ -34,6 +34,16 @@ export function isPortableIdentity(obj: unknown): obj is PortableIdentity { && isPortableDid(obj.did); } +/** + * This API is used to manage and interact with Identities within the Web5 Agent framework. + * An Identity is a DID that is associated with metadata that describes the Identity. + * Metadata includes A name(label), and whether or not the Identity is connected (delegated to act on the behalf of another DID). + * + * A KeyManager is used to manage the cryptographic keys associated with the Identities. + * + * The `DidApi` is used internally to create, store, and manage DIDs. + * When a DWN Data Store is used, the Identity and DID information are stored under the Agent DID's tenant. + */ export class AgentIdentityApi { /** * Holds the instance of a `Web5PlatformAgent` that represents the current execution context for