@fabrika/auth 0.9.0-dev.13 → 0.9.0-dev.14
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 +3 -3
- package/src/app-schema.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/auth",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"zod": "^3.25.76",
|
|
31
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
32
|
-
"@fabrika/jwks": "0.9.0-dev.
|
|
31
|
+
"@fabrika/auth-core": "0.9.0-dev.14",
|
|
32
|
+
"@fabrika/jwks": "0.9.0-dev.14",
|
|
33
33
|
"jose": "^5.9.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/app-schema.ts
CHANGED
|
@@ -279,11 +279,19 @@ export const appSchemaSchema = appSchemaShape.superRefine((schema, ctx) => {
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
for (const [relation, actions] of Object.entries(role.via ?? {})) {
|
|
282
|
-
if (role.
|
|
282
|
+
if (role.external === true) {
|
|
283
283
|
ctx.addIssue({
|
|
284
284
|
code: 'custom',
|
|
285
285
|
path: ['roles', key, 'via'],
|
|
286
|
-
message: `role ${quote(key)} holds actions via a relation and is
|
|
286
|
+
message: `role ${quote(key)} holds actions via a relation and is an external role`,
|
|
287
|
+
})
|
|
288
|
+
}
|
|
289
|
+
if (relation.includes(':')) {
|
|
290
|
+
// A grant at a value carries `~relin` `<relation>:<dimension>:<value>`, which a ':' in the name would misread.
|
|
291
|
+
ctx.addIssue({
|
|
292
|
+
code: 'custom',
|
|
293
|
+
path: ['roles', key, 'via', relation],
|
|
294
|
+
message: `role ${quote(key)} holds actions via ${quote(relation)}, a relation name with ':'`,
|
|
287
295
|
})
|
|
288
296
|
}
|
|
289
297
|
for (const [index, action] of actions.entries()) {
|