@verana-labs/vs-agent-client 2.0.0-dev.92 → 2.0.0-dev.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,7 +22,7 @@ const { id } = await client.didcomm.sendBasicMessage({ connectionId, content: 'H
22
22
 
23
23
  `baseUrl` is the admin origin. The client appends `/v2`.
24
24
 
25
- Auth. An agent in `ADMIN_API_AUTH_MODE=internal`, or a caller inside `ADMIN_API_TRUSTED_NETWORKS` in either mode, needs no token. A caller outside the trusted networks of an agent in `corporation` mode runs the ADR-036 flow with its own Cosmos signer: `client.auth.challenge({ account })`, sign `vs-agent-admin-auth:${nonce}`, `client.auth.token({ account, pubKey, signature, nonce })`, then build the client with the returned token. Tokens live 900 seconds, build a new `ApiClient` to refresh.
25
+ Auth. An agent in `ADMIN_API_AUTH_MODE=internal`, or a caller inside `ADMIN_API_TRUSTED_NETWORKS` in either mode, needs no token. A caller outside the trusted networks of an agent in `corporation` mode runs the ADR-036 flow with its own Cosmos signer: `client.auth.challenge({ account })`, check that the returned `audience` is the origin you called and refuse to sign otherwise, sign `vs-agent-admin-auth:${audience}:${nonce}`, `client.auth.token({ account, pubKey, signature, nonce })`, then build the client with the returned token. Tokens live 900 seconds, build a new `ApiClient` to refresh.
26
26
 
27
27
  ```ts
28
28
  const client = new ApiClient('https://agent.example.com', { token })
@@ -4,6 +4,7 @@ export interface ChallengeRequest {
4
4
  export interface ChallengeResponse {
5
5
  nonce: string;
6
6
  expiresAt: string;
7
+ audience: string;
7
8
  }
8
9
  export interface TokenRequest {
9
10
  account: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@verana-labs/vs-agent-client",
3
3
  "main": "build/index",
4
4
  "types": "build/index",
5
- "version": "2.0.0-dev.92",
5
+ "version": "2.0.0-dev.94",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/verana-labs/vs-agent"