@atlasauth/authz 0.1.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/dist/claims.d.ts +29 -0
- package/dist/claims.js +3 -0
- package/dist/claims.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +25 -0
- package/dist/keys.js +35 -0
- package/dist/keys.js.map +1 -0
- package/dist/protect.d.ts +64 -0
- package/dist/protect.js +94 -0
- package/dist/protect.js.map +1 -0
- package/package.json +22 -0
package/dist/claims.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimal, structural view of session claims the authorization primitive
|
|
3
|
+
* needs. Every SDK has its own richer `SessionClaims` (the backend verifier, the
|
|
4
|
+
* React session, the Next.js middleware); each is assignable to this shape, so
|
|
5
|
+
* they can all feed the SAME `evaluate()` without this package depending on any
|
|
6
|
+
* of them. Keeping it structural is deliberate — it is the seam that lets one
|
|
7
|
+
* primitive serve server, edge, and browser alike.
|
|
8
|
+
*/
|
|
9
|
+
export interface AuthzClaims {
|
|
10
|
+
/** The active organization, if the session has one selected. */
|
|
11
|
+
org_id?: string | null;
|
|
12
|
+
/** The user's role key in the active organization (e.g. `org:admin`). */
|
|
13
|
+
org_role?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* The permission keys the active-org role holds — the union of the role's
|
|
16
|
+
* direct permissions and any granted through group membership, exactly as the
|
|
17
|
+
* token was minted. Authorization reads this set; it never re-derives it.
|
|
18
|
+
*/
|
|
19
|
+
org_permissions?: readonly string[] | null;
|
|
20
|
+
/**
|
|
21
|
+
* §billing — the active plan slug (Clerk `has({plan})`), minted as `pla` only
|
|
22
|
+
* when the subject is entitled (its org's plan in a B2B org, else the user's).
|
|
23
|
+
* An unsubscribed token omits it. Unlike org permissions this needs NO active
|
|
24
|
+
* organization to evaluate.
|
|
25
|
+
*/
|
|
26
|
+
pla?: string | null;
|
|
27
|
+
/** §billing — the granted feature keys (Clerk `has({feature})`), minted as `fea`. */
|
|
28
|
+
fea?: readonly string[] | null;
|
|
29
|
+
}
|
package/dist/claims.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@atlasauth/authz` — the framework-agnostic authorization primitive shared by
|
|
3
|
+
* every Atlas SDK. Zero dependencies, no DOM, no Node: one `evaluate()` and one
|
|
4
|
+
* `ProtectCondition` so a permission check means the same thing in a browser, an
|
|
5
|
+
* edge middleware, and a Node server.
|
|
6
|
+
*/
|
|
7
|
+
export type { AuthzClaims } from './claims';
|
|
8
|
+
export { type ProtectCondition, type ProtectOutcome, type ProtectReason, evaluate, hasFromClaims, protectFromClaims, ForbiddenError, } from './protect';
|
|
9
|
+
export { ROLE_KEY_PATTERN, PERMISSION_KEY_PATTERN, isRoleKey, isPermissionKey, } from './keys';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPermissionKey = exports.isRoleKey = exports.PERMISSION_KEY_PATTERN = exports.ROLE_KEY_PATTERN = exports.ForbiddenError = exports.protectFromClaims = exports.hasFromClaims = exports.evaluate = void 0;
|
|
4
|
+
var protect_1 = require("./protect");
|
|
5
|
+
Object.defineProperty(exports, "evaluate", { enumerable: true, get: function () { return protect_1.evaluate; } });
|
|
6
|
+
Object.defineProperty(exports, "hasFromClaims", { enumerable: true, get: function () { return protect_1.hasFromClaims; } });
|
|
7
|
+
Object.defineProperty(exports, "protectFromClaims", { enumerable: true, get: function () { return protect_1.protectFromClaims; } });
|
|
8
|
+
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return protect_1.ForbiddenError; } });
|
|
9
|
+
var keys_1 = require("./keys");
|
|
10
|
+
Object.defineProperty(exports, "ROLE_KEY_PATTERN", { enumerable: true, get: function () { return keys_1.ROLE_KEY_PATTERN; } });
|
|
11
|
+
Object.defineProperty(exports, "PERMISSION_KEY_PATTERN", { enumerable: true, get: function () { return keys_1.PERMISSION_KEY_PATTERN; } });
|
|
12
|
+
Object.defineProperty(exports, "isRoleKey", { enumerable: true, get: function () { return keys_1.isRoleKey; } });
|
|
13
|
+
Object.defineProperty(exports, "isPermissionKey", { enumerable: true, get: function () { return keys_1.isPermissionKey; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAOA,qCAQmB;AAJjB,mGAAA,QAAQ,OAAA;AACR,wGAAA,aAAa,OAAA;AACb,4GAAA,iBAAiB,OAAA;AACjB,yGAAA,cAAc,OAAA;AAEhB,+BAKgB;AAJd,wGAAA,gBAAgB,OAAA;AAChB,8GAAA,sBAAsB,OAAA;AACtB,iGAAA,SAAS,OAAA;AACT,uGAAA,eAAe,OAAA"}
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role and permission KEY SHAPES — the single definition every layer shares.
|
|
3
|
+
*
|
|
4
|
+
* The two shapes are deliberately different, and the difference is meaningful:
|
|
5
|
+
*
|
|
6
|
+
* ROLE keys are `org:<segment>` — e.g. `org:admin`, `org:member`.
|
|
7
|
+
* PERMISSION keys are `org:<resource>:<action>` — e.g. `org:billing:manage`.
|
|
8
|
+
*
|
|
9
|
+
* A role names WHO someone is; a permission names WHAT they may do to a
|
|
10
|
+
* resource. That is why `<Protect role="org:admin">` and
|
|
11
|
+
* `<Protect permission="org:billing:manage">` both type-check but read
|
|
12
|
+
* differently — the arity of the key tells you which you are looking at.
|
|
13
|
+
*
|
|
14
|
+
* The full creation-time rules (reserved `sys_` prefix, immutability, length)
|
|
15
|
+
* live in `@atlas/core`'s validator, which imports these patterns so the two can
|
|
16
|
+
* never drift.
|
|
17
|
+
*/
|
|
18
|
+
/** `org:` then one lowercase segment. Matches a role key like `org:admin`. */
|
|
19
|
+
export declare const ROLE_KEY_PATTERN: RegExp;
|
|
20
|
+
/** `org:<resource>:<action>`. Matches a permission key like `org:billing:manage`. */
|
|
21
|
+
export declare const PERMISSION_KEY_PATTERN: RegExp;
|
|
22
|
+
/** True for a well-shaped role key (`org:admin`), false otherwise. */
|
|
23
|
+
export declare function isRoleKey(key: string): boolean;
|
|
24
|
+
/** True for a well-shaped permission key (`org:billing:manage`), false otherwise. */
|
|
25
|
+
export declare function isPermissionKey(key: string): boolean;
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Role and permission KEY SHAPES — the single definition every layer shares.
|
|
4
|
+
*
|
|
5
|
+
* The two shapes are deliberately different, and the difference is meaningful:
|
|
6
|
+
*
|
|
7
|
+
* ROLE keys are `org:<segment>` — e.g. `org:admin`, `org:member`.
|
|
8
|
+
* PERMISSION keys are `org:<resource>:<action>` — e.g. `org:billing:manage`.
|
|
9
|
+
*
|
|
10
|
+
* A role names WHO someone is; a permission names WHAT they may do to a
|
|
11
|
+
* resource. That is why `<Protect role="org:admin">` and
|
|
12
|
+
* `<Protect permission="org:billing:manage">` both type-check but read
|
|
13
|
+
* differently — the arity of the key tells you which you are looking at.
|
|
14
|
+
*
|
|
15
|
+
* The full creation-time rules (reserved `sys_` prefix, immutability, length)
|
|
16
|
+
* live in `@atlas/core`'s validator, which imports these patterns so the two can
|
|
17
|
+
* never drift.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.PERMISSION_KEY_PATTERN = exports.ROLE_KEY_PATTERN = void 0;
|
|
21
|
+
exports.isRoleKey = isRoleKey;
|
|
22
|
+
exports.isPermissionKey = isPermissionKey;
|
|
23
|
+
/** `org:` then one lowercase segment. Matches a role key like `org:admin`. */
|
|
24
|
+
exports.ROLE_KEY_PATTERN = /^org:[a-z][a-z0-9_]{1,31}$/;
|
|
25
|
+
/** `org:<resource>:<action>`. Matches a permission key like `org:billing:manage`. */
|
|
26
|
+
exports.PERMISSION_KEY_PATTERN = /^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;
|
|
27
|
+
/** True for a well-shaped role key (`org:admin`), false otherwise. */
|
|
28
|
+
function isRoleKey(key) {
|
|
29
|
+
return exports.ROLE_KEY_PATTERN.test(key);
|
|
30
|
+
}
|
|
31
|
+
/** True for a well-shaped permission key (`org:billing:manage`), false otherwise. */
|
|
32
|
+
function isPermissionKey(key) {
|
|
33
|
+
return exports.PERMISSION_KEY_PATTERN.test(key);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=keys.js.map
|
package/dist/keys.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AASH,8BAEC;AAGD,0CAEC;AAdD,8EAA8E;AACjE,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAE7D,qFAAqF;AACxE,QAAA,sBAAsB,GAAG,iDAAiD,CAAC;AAExF,sEAAsE;AACtE,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,wBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,qFAAqF;AACrF,SAAgB,eAAe,CAAC,GAAW;IACzC,OAAO,8BAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { AuthzClaims } from './claims';
|
|
2
|
+
/**
|
|
3
|
+
* The ONE authorization condition every Atlas SDK evaluates — `@atlasauth/backend`,
|
|
4
|
+
* `@atlasauth/nextjs`, `@atlasauth/react`, `@atlasauth/react-native`, and `@atlasauth/js` all
|
|
5
|
+
* import this exact shape and the `evaluate()` below. Before this package the
|
|
6
|
+
* same `has()` meant different things on different surfaces (React understood
|
|
7
|
+
* all four fields; Next.js understood only two; the backend had no `has()` at
|
|
8
|
+
* all). Centralizing the contract here is what makes a check portable across
|
|
9
|
+
* client and server.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProtectCondition {
|
|
12
|
+
/** A single permission the ACTIVE organization role must hold. */
|
|
13
|
+
permission?: string;
|
|
14
|
+
/** An exact role in the active organization. */
|
|
15
|
+
role?: string;
|
|
16
|
+
/** Any of these permissions (OR). */
|
|
17
|
+
anyPermission?: readonly string[];
|
|
18
|
+
/** All of these permissions (AND). */
|
|
19
|
+
allPermissions?: readonly string[];
|
|
20
|
+
/** The active billing plan (Clerk `has({ plan })`) — matches the `pla` claim.
|
|
21
|
+
* Needs NO active organization: it is the subject's entitlement. */
|
|
22
|
+
plan?: string;
|
|
23
|
+
/** A granted feature (Clerk `has({ feature })`) — an entry in the `fea` claim. */
|
|
24
|
+
feature?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ProtectReason = 'signed_out' | 'no_organization' | 'missing_permission' | 'missing_entitlement';
|
|
27
|
+
export type ProtectOutcome = {
|
|
28
|
+
allowed: true;
|
|
29
|
+
} | {
|
|
30
|
+
allowed: false;
|
|
31
|
+
reason: ProtectReason;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Whether `claims` satisfy `condition`, with a reason when they do not.
|
|
35
|
+
*
|
|
36
|
+
* An empty condition means "signed in", which is the common case and reads
|
|
37
|
+
* naturally as `<Protect>` / `has({})`. Requiring an explicit `signedIn` flag
|
|
38
|
+
* would make the simplest usage the noisiest.
|
|
39
|
+
*
|
|
40
|
+
* A user with no active organization FAILS any organization condition rather
|
|
41
|
+
* than passing it vacuously: `allPermissions: []` against no org must not render
|
|
42
|
+
* an admin panel just because the empty set is trivially satisfied. (This is the
|
|
43
|
+
* exact case where the old Next.js `has()` and React `has()` disagreed — they
|
|
44
|
+
* now share this one rule.)
|
|
45
|
+
*/
|
|
46
|
+
export declare function evaluate(claims: AuthzClaims | null | undefined, condition?: ProtectCondition): ProtectOutcome;
|
|
47
|
+
/** The boolean form — the primitive behind every surface's `has(condition)`. */
|
|
48
|
+
export declare function hasFromClaims(claims: AuthzClaims | null | undefined, condition?: ProtectCondition): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The error `protect()` throws when a condition is not met. Carrying the reason
|
|
51
|
+
* (and the failed condition) lets a server framework map it to the right status:
|
|
52
|
+
* `signed_out` → 401, everything else → 403/404 per the app's convention.
|
|
53
|
+
*/
|
|
54
|
+
export declare class ForbiddenError extends Error {
|
|
55
|
+
readonly reason: ProtectReason;
|
|
56
|
+
readonly condition: ProtectCondition;
|
|
57
|
+
constructor(reason: ProtectReason, condition: ProtectCondition);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Assert a condition, throwing `ForbiddenError` when it fails. The imperative
|
|
61
|
+
* companion to `hasFromClaims` — a server route calls this to hard-stop a
|
|
62
|
+
* request, the same way Clerk's `auth().protect()` does.
|
|
63
|
+
*/
|
|
64
|
+
export declare function protectFromClaims(claims: AuthzClaims | null | undefined, condition?: ProtectCondition): void;
|
package/dist/protect.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForbiddenError = void 0;
|
|
4
|
+
exports.evaluate = evaluate;
|
|
5
|
+
exports.hasFromClaims = hasFromClaims;
|
|
6
|
+
exports.protectFromClaims = protectFromClaims;
|
|
7
|
+
/** The condition fields that require an active organization to satisfy. */
|
|
8
|
+
function wantsOrgContext(condition) {
|
|
9
|
+
return (condition.permission !== undefined ||
|
|
10
|
+
condition.role !== undefined ||
|
|
11
|
+
condition.anyPermission !== undefined ||
|
|
12
|
+
condition.allPermissions !== undefined);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Whether `claims` satisfy `condition`, with a reason when they do not.
|
|
16
|
+
*
|
|
17
|
+
* An empty condition means "signed in", which is the common case and reads
|
|
18
|
+
* naturally as `<Protect>` / `has({})`. Requiring an explicit `signedIn` flag
|
|
19
|
+
* would make the simplest usage the noisiest.
|
|
20
|
+
*
|
|
21
|
+
* A user with no active organization FAILS any organization condition rather
|
|
22
|
+
* than passing it vacuously: `allPermissions: []` against no org must not render
|
|
23
|
+
* an admin panel just because the empty set is trivially satisfied. (This is the
|
|
24
|
+
* exact case where the old Next.js `has()` and React `has()` disagreed — they
|
|
25
|
+
* now share this one rule.)
|
|
26
|
+
*/
|
|
27
|
+
function evaluate(claims, condition = {}) {
|
|
28
|
+
if (!claims)
|
|
29
|
+
return { allowed: false, reason: 'signed_out' };
|
|
30
|
+
// Entitlement (plan/feature) is the subject's own — its org's in a B2B org,
|
|
31
|
+
// else the user's — minted as `pla`/`fea`. It does NOT require an active
|
|
32
|
+
// organization, so it is checked before the org-context gate below.
|
|
33
|
+
if (condition.plan !== undefined && claims.pla !== condition.plan) {
|
|
34
|
+
return { allowed: false, reason: 'missing_entitlement' };
|
|
35
|
+
}
|
|
36
|
+
if (condition.feature !== undefined && !(claims.fea ?? []).includes(condition.feature)) {
|
|
37
|
+
return { allowed: false, reason: 'missing_entitlement' };
|
|
38
|
+
}
|
|
39
|
+
if (!wantsOrgContext(condition))
|
|
40
|
+
return { allowed: true };
|
|
41
|
+
if (!claims.org_id)
|
|
42
|
+
return { allowed: false, reason: 'no_organization' };
|
|
43
|
+
const held = new Set(claims.org_permissions ?? []);
|
|
44
|
+
if (condition.role !== undefined && claims.org_role !== condition.role) {
|
|
45
|
+
return { allowed: false, reason: 'missing_permission' };
|
|
46
|
+
}
|
|
47
|
+
if (condition.permission !== undefined && !held.has(condition.permission)) {
|
|
48
|
+
return { allowed: false, reason: 'missing_permission' };
|
|
49
|
+
}
|
|
50
|
+
if (condition.anyPermission && !condition.anyPermission.some((p) => held.has(p))) {
|
|
51
|
+
return { allowed: false, reason: 'missing_permission' };
|
|
52
|
+
}
|
|
53
|
+
if (condition.allPermissions && !condition.allPermissions.every((p) => held.has(p))) {
|
|
54
|
+
return { allowed: false, reason: 'missing_permission' };
|
|
55
|
+
}
|
|
56
|
+
return { allowed: true };
|
|
57
|
+
}
|
|
58
|
+
/** The boolean form — the primitive behind every surface's `has(condition)`. */
|
|
59
|
+
function hasFromClaims(claims, condition = {}) {
|
|
60
|
+
return evaluate(claims, condition).allowed;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The error `protect()` throws when a condition is not met. Carrying the reason
|
|
64
|
+
* (and the failed condition) lets a server framework map it to the right status:
|
|
65
|
+
* `signed_out` → 401, everything else → 403/404 per the app's convention.
|
|
66
|
+
*/
|
|
67
|
+
class ForbiddenError extends Error {
|
|
68
|
+
reason;
|
|
69
|
+
condition;
|
|
70
|
+
constructor(reason, condition) {
|
|
71
|
+
super(reason === 'signed_out'
|
|
72
|
+
? 'Not signed in.'
|
|
73
|
+
: reason === 'no_organization'
|
|
74
|
+
? 'No active organization for this authorization check.'
|
|
75
|
+
: reason === 'missing_entitlement'
|
|
76
|
+
? 'Missing the required plan or feature.'
|
|
77
|
+
: 'Missing the required permission or role.');
|
|
78
|
+
this.name = 'ForbiddenError';
|
|
79
|
+
this.reason = reason;
|
|
80
|
+
this.condition = condition;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.ForbiddenError = ForbiddenError;
|
|
84
|
+
/**
|
|
85
|
+
* Assert a condition, throwing `ForbiddenError` when it fails. The imperative
|
|
86
|
+
* companion to `hasFromClaims` — a server route calls this to hard-stop a
|
|
87
|
+
* request, the same way Clerk's `auth().protect()` does.
|
|
88
|
+
*/
|
|
89
|
+
function protectFromClaims(claims, condition = {}) {
|
|
90
|
+
const outcome = evaluate(claims, condition);
|
|
91
|
+
if (!outcome.allowed)
|
|
92
|
+
throw new ForbiddenError(outcome.reason, condition);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=protect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protect.js","sourceRoot":"","sources":["../src/protect.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlasauth/authz",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"typescript": "^5.6.3",
|
|
8
|
+
"vitest": "^2.1.4"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
20
|
+
"test": "vitest run"
|
|
21
|
+
}
|
|
22
|
+
}
|