@adonis-agora/authkit-sdk 1.0.0-rc.3 → 1.0.0-rc.5
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/CHANGELOG.md +20 -0
- package/build/src/types.d.ts +7 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @adonis-agora/authkit-sdk
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.5
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#502](https://github.com/DavideCarvalho/adonis-agora-authkit/pull/502) [`4c91361`](https://github.com/DavideCarvalho/adonis-agora-authkit/commit/4c91361fe209ee76e1cc4a0a3189568f6d4c0558) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Read-only keystore: `jwks: { source: 'managed', store, readOnly: true }` lets a second authkit-server serve the same identity (same keystore, same `auth_settings`) under another issuer while only the first one writes the keys. A read-only instance never runs the scheduled rotation and picks up the writer's rotations through the reload poll. Rotate, generate, retire and reseal throw `KeystoreReadOnlyError` (`E_KEYSTORE_READ_ONLY`): `authkit:key generate|rotate|retire` and `authkit:crypto:reseal` exit 1 (their `--dry-run` still works), the Admin API and the console answer `409 keystore_read_only`, and the console's Keys page hides those actions (`GET /keys` returns `readOnly: true`). The `key_rotation` setting reads but can't be changed there (`409 keystore_read_only`). At boot it reads the keystore and fails with `KeystoreUnavailableError` (`E_KEYSTORE_UNAVAILABLE`) when it's missing or doesn't open: it never creates a key or a table. `agora:doctor` adds the **Keystore read-only** check. `authkit:settings:unset` now exits 1 when it refuses a locked key (it used to print the refusal and exit 0, and for a key locked by `defineConfig` it reported "not set").
|
|
8
|
+
|
|
9
|
+
## 1.0.0-rc.4
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#495](https://github.com/DavideCarvalho/adonis-agora-authkit/pull/495) [`4830805`](https://github.com/DavideCarvalho/adonis-agora-authkit/commit/4830805039c3f0e978c403d3062275a892704eb7) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Separate servers: every piece of an Agora deployment can run without authkit-server in its process.
|
|
14
|
+
|
|
15
|
+
- `authkitTenantVerifier({ issuer, resource, environment? })` (authkit-client) verifies service-tenant tokens on any server against the issuer's discovered JWKS and returns `{ partition, environment?, capabilities, clientId, expiresAt }` or `null`. `authkitTenantToken` now takes the token endpoint only from discovery (no guessed path).
|
|
16
|
+
- Service tenants get an optional `environment` (console, Admin API, SDK, `--environment`), emitted as the `environment` claim. Both verifiers take `environment` and, when it is set, accept only tokens claiming exactly that environment (fail closed); authkit-server's in-process verifier also returns `environment`. One service-tenant client gets tokens for every `urn:agora:*` resource declared.
|
|
17
|
+
- `registerOidcClient` announces `POST /auth/logout` as `account.signOut` on the `agora.consoles` registry (skipped when authkit-server runs in the app), so every console shows a sign-out.
|
|
18
|
+
- `Identity.actor` (`{ sub, email? }`) from the RFC 8693 `act` claim of an impersonated token (`deriveActor` in authkit-core).
|
|
19
|
+
- Org labels: authkit-server serves `GET /api/orgs/labels?ids=` (first-party confidential clients, Basic auth) and emits `org_name` for the active org; authkit-client installs a cached `Context.setTenantLabeler` (`orgLabels` option, `authkitOrgLabels`).
|
|
20
|
+
- Webhooks: the body carries `id` and `actorId`, `events.webhook` accepts a list; authkit-client's `registerAuthkitWebhook` / `authkitWebhookHandler` verify the HMAC, the `ts` window and the id, and re-emit on the diagnostics bus as `agora:authkit:<type>` with the in-process payload.
|
|
21
|
+
- `identityFromAccessToken`, `bindAuthkitIdentity` and `bridgeAuthkitToken` put a verified authkit bearer token on `ctx.authkit`.
|
|
22
|
+
|
|
3
23
|
## 1.0.0-rc.3
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
package/build/src/types.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface AuthkitClient {
|
|
|
120
120
|
serviceTenant: {
|
|
121
121
|
partition: string;
|
|
122
122
|
capabilities: string[];
|
|
123
|
+
environment?: string;
|
|
123
124
|
} | null;
|
|
124
125
|
}
|
|
125
126
|
/** `clients.list`: `search` matches the client id or name; `sort` is `clientId` or `clientName`. */
|
|
@@ -142,6 +143,7 @@ export interface ClientInput {
|
|
|
142
143
|
serviceTenant?: {
|
|
143
144
|
partition: string;
|
|
144
145
|
capabilities?: string[];
|
|
146
|
+
environment?: string | null;
|
|
145
147
|
} | null;
|
|
146
148
|
}
|
|
147
149
|
/** Created/regenerated client — the secret is shown ONCE (`createdClientDto`). */
|
|
@@ -332,6 +334,11 @@ export interface KeysStatus {
|
|
|
332
334
|
keep: number;
|
|
333
335
|
};
|
|
334
336
|
nextRotationInDays: number | null;
|
|
337
|
+
/**
|
|
338
|
+
* `jwks.readOnly` on the server: it reads the keystore another instance writes, so `rotate()`
|
|
339
|
+
* fails with 409 `keystore_read_only`. Absent on older servers.
|
|
340
|
+
*/
|
|
341
|
+
readOnly?: boolean;
|
|
335
342
|
}
|
|
336
343
|
/** Input for `keys.rotate()`. */
|
|
337
344
|
export interface KeysRotateInput {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-sdk",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"description": "Backend SDK for the AuthKit Admin API with one typed interface and two drivers: remote (HTTP/Bearer) and embedded (in-process when the IdP runs in the same AdonisJS app).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "dudousxd",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@adonis-agora/authkit-server": "1.0.0-rc.
|
|
54
|
+
"@adonis-agora/authkit-server": "1.0.0-rc.31",
|
|
55
55
|
"@adonisjs/core": "7.6.0",
|
|
56
56
|
"@adonisjs/tsconfig": "2.0.0",
|
|
57
57
|
"@japa/assert": "4.2.0",
|