@warlock.js/access 5.34.2 → 5.35.0
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 +6 -0
- package/llms-full.txt +6 -6
- package/llms.txt +6 -6
- package/package.json +7 -7
- package/skills/index.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@warlock.js/access` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.34.3 - 2026-10-20
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Condensed the package agent skill description to at most 450 characters, with API names and package routing guidance.
|
|
12
|
+
|
|
7
13
|
## 5.34.2 - 2026-10-19
|
|
8
14
|
|
|
9
15
|
### Fixed
|
package/llms-full.txt
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## Package orientation
|
|
8
8
|
|
|
9
9
|
---
|
|
10
|
-
description: 'Authorization
|
|
10
|
+
description: 'Authorization with RBAC and ABAC: `can`, `authorize`, `gate`, `gateAny`, `definePolicy`, `hasRole`, `access` and `AccessResolver`. Use for "check a permission", "only the owner can edit", route policies, tenant roles or custom permission storage. Not this package → @warlock.js/auth for login, tokens and user-type guards; @warlock.js/seal for request validation.'
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# @warlock.js/access
|
|
@@ -60,7 +60,7 @@ Skip if you only need "is the user an admin" — `authMiddleware("admin")` from
|
|
|
60
60
|
- The `protect-routes` topic of the `warlock-js-auth` skill — `authMiddleware`; stack `gate` after it.
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
## check-permissions `@warlock.js/access/check-permissions/SKILL.md`
|
|
63
|
+
## check-permissions `@warlock.js/access/skills/check-permissions/SKILL.md`
|
|
64
64
|
|
|
65
65
|
---
|
|
66
66
|
name: check-permissions
|
|
@@ -137,7 +137,7 @@ await authorize(user, "orders.update", { resource: order, tenant }); // grant AN
|
|
|
137
137
|
- The `protect-routes` topic of the `warlock-js-auth` skill — `authMiddleware`, which runs first.
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
## configure-access `@warlock.js/access/configure-access/SKILL.md`
|
|
140
|
+
## configure-access `@warlock.js/access/skills/configure-access/SKILL.md`
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
name: configure-access
|
|
@@ -229,7 +229,7 @@ The engine caches each user's resolved set (`cache.ttl`, default `10m`). Roles c
|
|
|
229
229
|
- The `manage-roles` topic — assign / revoke with the ejected table.
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
## define-policies `@warlock.js/access/define-policies/SKILL.md`
|
|
232
|
+
## define-policies `@warlock.js/access/skills/define-policies/SKILL.md`
|
|
233
233
|
|
|
234
234
|
---
|
|
235
235
|
name: define-policies
|
|
@@ -304,7 +304,7 @@ definePolicy(
|
|
|
304
304
|
- The `check-permissions` topic — `authorize(…, { resource })`.
|
|
305
305
|
|
|
306
306
|
|
|
307
|
-
## implement-resolver `@warlock.js/access/implement-resolver/SKILL.md`
|
|
307
|
+
## implement-resolver `@warlock.js/access/skills/implement-resolver/SKILL.md`
|
|
308
308
|
|
|
309
309
|
---
|
|
310
310
|
name: implement-resolver
|
|
@@ -413,7 +413,7 @@ class DirectResolver implements AccessResolver {
|
|
|
413
413
|
- The `configure-access` topic — the quickstart `DefaultAccessResolver`.
|
|
414
414
|
|
|
415
415
|
|
|
416
|
-
## manage-roles `@warlock.js/access/manage-roles/SKILL.md`
|
|
416
|
+
## manage-roles `@warlock.js/access/skills/manage-roles/SKILL.md`
|
|
417
417
|
|
|
418
418
|
---
|
|
419
419
|
name: manage-roles
|
package/llms.txt
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## Skills
|
|
8
8
|
|
|
9
|
-
- [Package orientation](@warlock.js/access/skills/index.md): Authorization
|
|
10
|
-
- [check-permissions](@warlock.js/access/check-permissions/SKILL.md): Check permissions in `@warlock.js/access` — `can` / `cannot` / `canAll` / `canAny` (boolean), `authorize` / `authorizeAll` / `authorizeAny` (throw 403), and the `gate` / `gateAny` / `gateAll` route middleware. Class-level vs instance-level (pass a `resource` to run its policy). TRIGGER: `can(`, `authorize(`, `canAll`, `canAny`, `gate`, `gateAny`, `gateAll`, "check a permission", "protect route by permission", "403 forbidden", "any vs all permissions". Skip: ownership / tenant conditions — the `define-policies` topic; role checks — the `manage-roles` topic.
|
|
11
|
-
- [configure-access](@warlock.js/access/configure-access/SKILL.md): Configure `@warlock.js/access` — the REQUIRED `resolver` (the quickstart `DefaultAccessResolver` over a fixed code map vs the ejected, DB-backed `DatabaseAccessResolver`), `cache: { ttl }`, and the ambient tenant via the resolver's optional `resolveTenant()`. TRIGGER: `AccessConfigurations`, `config.access`, `src/config/access.ts`, "set up permissions", "DefaultAccessResolver", "DatabaseAccessResolver", "access cache ttl", "access tenant". Skip: checking permissions — the `check-permissions` topic; custom storage — the `implement-resolver` topic.
|
|
12
|
-
- [define-policies](@warlock.js/access/define-policies/SKILL.md): ABAC conditions in `@warlock.js/access` — `definePolicy(permission, (user, resource, ctx) => boolean)` adds an instance-level rule (ownership / tenant / state) on top of the RBAC grant, evaluated when an authorization check carries a `resource`. TRIGGER: `definePolicy`, "ownership check", "only their own", "can edit this specific record", "ABAC", "policy", "resource-level permission", `authorize(user, perm, { resource })`. Skip: plain grant checks — the `check-permissions` topic.
|
|
13
|
-
- [implement-resolver](@warlock.js/access/implement-resolver/SKILL.md): Connect `@warlock.js/access` to your role/permission storage by implementing the `AccessResolver` contract (`resolveRoles` / `resolvePermissions`, optional `resolveTenant`) — for a DB-backed catalog, a user column, a pivot table, a token claim, or an external directory. The engine owns matching / caching / policies; the resolver only fetches. TRIGGER: `AccessResolver`, `DatabaseAccessResolver`, `resolveTenant`, "custom resolver", "where do roles come from", "roles in a token claim", "permissions from an external API", "implement resolver". Skip: the quickstart `DefaultAccessResolver` — the `configure-access` topic.
|
|
14
|
-
- [manage-roles](@warlock.js/access/manage-roles/SKILL.md): Assign and read roles in `@warlock.js/access` — the ejected `UserRole.assign` / `UserRole.revoke` (the `user_roles` table) followed by `access.flush`, plus `hasRole` / `hasAnyRole` / `hasAllRoles`. The role→permission catalog is the ejected `Role` table (dynamic). TRIGGER: `UserRole.assign`, `UserRole.revoke`, `access.flush`, `hasRole`, `hasAnyRole`, `hasAllRoles`, `Role` table, "give a user a role", "assign role", "check a user role", "roles per tenant". Skip: permission checks — the `check-permissions` topic; resolver choice — the `configure-access` topic.
|
|
9
|
+
- [Package orientation](@warlock.js/access/skills/index.md): Authorization with RBAC and ABAC: `can`, `authorize`, `gate`, `gateAny`, `definePolicy`, `hasRole`, `access` and `AccessResolver`. Use for "check a permission", "only the owner can edit", route policies, tenant roles or custom permission storage. Not this package → @warlock.js/auth for login, tokens and user-type guards; @warlock.js/seal for request validation.
|
|
10
|
+
- [check-permissions](@warlock.js/access/skills/check-permissions/SKILL.md): Check permissions in `@warlock.js/access` — `can` / `cannot` / `canAll` / `canAny` (boolean), `authorize` / `authorizeAll` / `authorizeAny` (throw 403), and the `gate` / `gateAny` / `gateAll` route middleware. Class-level vs instance-level (pass a `resource` to run its policy). TRIGGER: `can(`, `authorize(`, `canAll`, `canAny`, `gate`, `gateAny`, `gateAll`, "check a permission", "protect route by permission", "403 forbidden", "any vs all permissions". Skip: ownership / tenant conditions — the `define-policies` topic; role checks — the `manage-roles` topic.
|
|
11
|
+
- [configure-access](@warlock.js/access/skills/configure-access/SKILL.md): Configure `@warlock.js/access` — the REQUIRED `resolver` (the quickstart `DefaultAccessResolver` over a fixed code map vs the ejected, DB-backed `DatabaseAccessResolver`), `cache: { ttl }`, and the ambient tenant via the resolver's optional `resolveTenant()`. TRIGGER: `AccessConfigurations`, `config.access`, `src/config/access.ts`, "set up permissions", "DefaultAccessResolver", "DatabaseAccessResolver", "access cache ttl", "access tenant". Skip: checking permissions — the `check-permissions` topic; custom storage — the `implement-resolver` topic.
|
|
12
|
+
- [define-policies](@warlock.js/access/skills/define-policies/SKILL.md): ABAC conditions in `@warlock.js/access` — `definePolicy(permission, (user, resource, ctx) => boolean)` adds an instance-level rule (ownership / tenant / state) on top of the RBAC grant, evaluated when an authorization check carries a `resource`. TRIGGER: `definePolicy`, "ownership check", "only their own", "can edit this specific record", "ABAC", "policy", "resource-level permission", `authorize(user, perm, { resource })`. Skip: plain grant checks — the `check-permissions` topic.
|
|
13
|
+
- [implement-resolver](@warlock.js/access/skills/implement-resolver/SKILL.md): Connect `@warlock.js/access` to your role/permission storage by implementing the `AccessResolver` contract (`resolveRoles` / `resolvePermissions`, optional `resolveTenant`) — for a DB-backed catalog, a user column, a pivot table, a token claim, or an external directory. The engine owns matching / caching / policies; the resolver only fetches. TRIGGER: `AccessResolver`, `DatabaseAccessResolver`, `resolveTenant`, "custom resolver", "where do roles come from", "roles in a token claim", "permissions from an external API", "implement resolver". Skip: the quickstart `DefaultAccessResolver` — the `configure-access` topic.
|
|
14
|
+
- [manage-roles](@warlock.js/access/skills/manage-roles/SKILL.md): Assign and read roles in `@warlock.js/access` — the ejected `UserRole.assign` / `UserRole.revoke` (the `user_roles` table) followed by `access.flush`, plus `hasRole` / `hasAnyRole` / `hasAllRoles`. The role→permission catalog is the ejected `Role` table (dynamic). TRIGGER: `UserRole.assign`, `UserRole.revoke`, `access.flush`, `hasRole`, `hasAnyRole`, `hasAllRoles`, `Role` table, "give a user a role", "assign role", "check a user role", "roles per tenant". Skip: permission checks — the `check-permissions` topic; resolver choice — the `configure-access` topic.
|
package/package.json
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
"environment": "server"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@warlock.js/auth": "5.
|
|
9
|
-
"@warlock.js/cache": "5.
|
|
10
|
-
"@warlock.js/cascade": "5.
|
|
11
|
-
"@warlock.js/core": "5.
|
|
12
|
-
"@warlock.js/logger": "5.
|
|
13
|
-
"@warlock.js/seal": "5.
|
|
8
|
+
"@warlock.js/auth": "5.35.0",
|
|
9
|
+
"@warlock.js/cache": "5.35.0",
|
|
10
|
+
"@warlock.js/cascade": "5.35.0",
|
|
11
|
+
"@warlock.js/core": "5.35.0",
|
|
12
|
+
"@warlock.js/logger": "5.35.0",
|
|
13
|
+
"@warlock.js/seal": "5.35.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"author": "hassanzohdy",
|
|
30
30
|
"license": "MIT",
|
|
31
|
-
"version": "5.
|
|
31
|
+
"version": "5.35.0",
|
|
32
32
|
"main": "./cjs/index.cjs",
|
|
33
33
|
"module": "./esm/index.mjs",
|
|
34
34
|
"types": "./esm/index.d.mts",
|
package/skills/index.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: 'Authorization
|
|
2
|
+
description: 'Authorization with RBAC and ABAC: `can`, `authorize`, `gate`, `gateAny`, `definePolicy`, `hasRole`, `access` and `AccessResolver`. Use for "check a permission", "only the owner can edit", route policies, tenant roles or custom permission storage. Not this package → @warlock.js/auth for login, tokens and user-type guards; @warlock.js/seal for request validation.'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# @warlock.js/access
|