@fabrika/iam 0.9.0-dev.28 → 0.9.0-dev.29
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/package.json +10 -10
- package/src/issue.ts +5 -3
- package/types/src/issue.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/iam",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.29",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/contember/fabrika-platform.git",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"prune:auth-log": "bun src/node/prune.ts"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@fabrika/app": "0.9.0-dev.
|
|
60
|
-
"@fabrika/auth": "0.9.0-dev.
|
|
61
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
62
|
-
"@fabrika/email": "0.9.0-dev.
|
|
63
|
-
"@fabrika/iam-contract": "0.9.0-dev.
|
|
64
|
-
"@fabrika/platform": "0.9.0-dev.
|
|
65
|
-
"@fabrika/platform-node": "0.9.0-dev.
|
|
66
|
-
"@fabrika/provider-cloudflare": "0.9.0-dev.
|
|
67
|
-
"@fabrika/proxy-core": "0.9.0-dev.
|
|
59
|
+
"@fabrika/app": "0.9.0-dev.29",
|
|
60
|
+
"@fabrika/auth": "0.9.0-dev.29",
|
|
61
|
+
"@fabrika/auth-core": "0.9.0-dev.29",
|
|
62
|
+
"@fabrika/email": "0.9.0-dev.29",
|
|
63
|
+
"@fabrika/iam-contract": "0.9.0-dev.29",
|
|
64
|
+
"@fabrika/platform": "0.9.0-dev.29",
|
|
65
|
+
"@fabrika/platform-node": "0.9.0-dev.29",
|
|
66
|
+
"@fabrika/provider-cloudflare": "0.9.0-dev.29",
|
|
67
|
+
"@fabrika/proxy-core": "0.9.0-dev.29",
|
|
68
68
|
"jose": "^5.9.0",
|
|
69
69
|
"zod": "^3.25.76"
|
|
70
70
|
}
|
package/src/issue.ts
CHANGED
|
@@ -236,8 +236,9 @@ function credentialGrantToKeyGrant(row: CredentialGrantRow): KeyGrant[] {
|
|
|
236
236
|
* app cannot probe or end another app's keys. Within the app, authorization mirrors the old capability
|
|
237
237
|
* revoke: the original issuer may always revoke; otherwise, for an ANONYMOUS credential (a share
|
|
238
238
|
* link), the caller must be able to re-issue its grants — hold every granted action, checked with the
|
|
239
|
-
* same `findUncoveredGrant` as issue
|
|
240
|
-
* path (the api-keys page), so a
|
|
239
|
+
* same `findUncoveredGrant` as issue; one with no grant but reserved rows is the issuer's alone. A
|
|
240
|
+
* principal-bound credential is managed through the principal path (the api-keys page), so a
|
|
241
|
+
* non-issuer caller cannot revoke it by id here. Idempotent — a second
|
|
241
242
|
* revoke returns `{ ok: true, revoked: false }`.
|
|
242
243
|
*/
|
|
243
244
|
export async function revokeKey(
|
|
@@ -256,7 +257,8 @@ export async function revokeKey(
|
|
|
256
257
|
return { ok: false, reason: 'not_allowed' }
|
|
257
258
|
}
|
|
258
259
|
const grants = (await services.repositories.credentials.getCredentialGrants(cred.id)).flatMap(credentialGrantToKeyGrant)
|
|
259
|
-
|
|
260
|
+
// No grant left to re-issue (a legacy key of reserved rows only) proves no right over the key: its issuer's alone.
|
|
261
|
+
if (grants.length === 0 || findUncoveredGrant(revoker.permissions, grants) !== null) {
|
|
260
262
|
return { ok: false, reason: 'not_allowed' }
|
|
261
263
|
}
|
|
262
264
|
}
|
package/types/src/issue.d.ts
CHANGED
|
@@ -54,8 +54,9 @@ export declare function issueKey(services: Services, input: IssueKeyInput, issue
|
|
|
54
54
|
* app cannot probe or end another app's keys. Within the app, authorization mirrors the old capability
|
|
55
55
|
* revoke: the original issuer may always revoke; otherwise, for an ANONYMOUS credential (a share
|
|
56
56
|
* link), the caller must be able to re-issue its grants — hold every granted action, checked with the
|
|
57
|
-
* same `findUncoveredGrant` as issue
|
|
58
|
-
* path (the api-keys page), so a
|
|
57
|
+
* same `findUncoveredGrant` as issue; one with no grant but reserved rows is the issuer's alone. A
|
|
58
|
+
* principal-bound credential is managed through the principal path (the api-keys page), so a
|
|
59
|
+
* non-issuer caller cannot revoke it by id here. Idempotent — a second
|
|
59
60
|
* revoke returns `{ ok: true, revoked: false }`.
|
|
60
61
|
*/
|
|
61
62
|
export declare function revokeKey(services: Services, input: RevokeKeyInput, revoker: Issuer, app: string, record?: AuditEventInput): Promise<RevokeKeyResult>;
|