@authup/access 1.0.0-beta.65 → 1.0.0-beta.66

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.
Files changed (38) hide show
  1. package/dist/index.d.mts +476 -64
  2. package/dist/index.d.mts.map +1 -1
  3. package/dist/index.mjs +715 -27
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/permission/authorization/check-schema.d.ts +23 -0
  6. package/dist/permission/authorization/check-schema.d.ts.map +1 -0
  7. package/dist/permission/authorization/check.d.ts +7 -0
  8. package/dist/permission/authorization/check.d.ts.map +1 -0
  9. package/dist/permission/authorization/constants.d.ts +14 -0
  10. package/dist/permission/authorization/constants.d.ts.map +1 -0
  11. package/dist/permission/authorization/error.d.ts +18 -0
  12. package/dist/permission/authorization/error.d.ts.map +1 -0
  13. package/dist/permission/authorization/index.d.ts +9 -0
  14. package/dist/permission/authorization/index.d.ts.map +1 -0
  15. package/dist/permission/authorization/module.d.ts +70 -0
  16. package/dist/permission/authorization/module.d.ts.map +1 -0
  17. package/dist/permission/authorization/policy.d.ts +23 -0
  18. package/dist/permission/authorization/policy.d.ts.map +1 -0
  19. package/dist/permission/authorization/schema.d.ts +107 -0
  20. package/dist/permission/authorization/schema.d.ts.map +1 -0
  21. package/dist/permission/authorization/types.d.ts +122 -0
  22. package/dist/permission/authorization/types.d.ts.map +1 -0
  23. package/dist/permission/evaluator/module.d.ts.map +1 -1
  24. package/dist/permission/evaluator/types.d.ts +8 -0
  25. package/dist/permission/evaluator/types.d.ts.map +1 -1
  26. package/dist/permission/index.d.ts +1 -0
  27. package/dist/permission/index.d.ts.map +1 -1
  28. package/dist/policy/built-in/permission-binding/identity-evaluator.d.ts +21 -0
  29. package/dist/policy/built-in/permission-binding/identity-evaluator.d.ts.map +1 -0
  30. package/dist/policy/built-in/permission-binding/index.d.ts +1 -0
  31. package/dist/policy/built-in/permission-binding/index.d.ts.map +1 -1
  32. package/dist/policy/built-in/permission-binding/validator.d.ts.map +1 -1
  33. package/dist/policy/data.d.ts +2 -0
  34. package/dist/policy/data.d.ts.map +1 -1
  35. package/dist/policy/evaluation/context/define.d.ts.map +1 -1
  36. package/dist/policy/evaluation/context/types.d.ts +9 -0
  37. package/dist/policy/evaluation/context/types.d.ts.map +1 -1
  38. package/package.json +5 -5
package/dist/index.d.mts CHANGED
@@ -3,12 +3,14 @@ import { DecisionStrategy } from "@authup/kit";
3
3
  import { ICondition } from "@rapiq/core";
4
4
  import { Issue, IssueGroup, IssueItem } from "@ebec/core";
5
5
  import { Container } from "validup";
6
+ import { z } from "zod";
6
7
  import { MongoFiltersParser, MongoFiltersParserInput } from "@rapiq/parser-mongo";
7
8
  //#region src/policy/data.d.ts
8
9
  export interface IPolicyData {
9
10
  set(key: string, value: unknown): void;
10
11
  has(key: string): boolean;
11
12
  get<T = unknown>(key: string): T;
13
+ delete(key: string): void;
12
14
  isValidated(key: string): boolean;
13
15
  setValidated(key: string): void;
14
16
  clone(): IPolicyData;
@@ -20,6 +22,7 @@ export declare class PolicyData implements IPolicyData {
20
22
  set<T = unknown>(key: string, value: T): void;
21
23
  get<T = unknown>(key: string): T;
22
24
  has(key: string): boolean;
25
+ delete(key: string): void;
23
26
  setValidated(key: string): void;
24
27
  isValidated(key: string): boolean;
25
28
  clone(): PolicyData;
@@ -39,6 +42,15 @@ export type PolicyEvaluationContext = {
39
42
  * query-build callers opt in.
40
43
  */
41
44
  readonly withConditions: boolean;
45
+ /**
46
+ * Row column the realm reach is LOWERED onto, for a caller whose rows carry the
47
+ * realm under another name (a junction's `roleRealmId` / `clientRealmId` / …).
48
+ * Default `realmId`. It reaches `RealmMatchPolicyEvaluator` scope mode as
49
+ * `attributeName`, which that mode reads only while lowering — settled
50
+ * evaluation takes the resource realm from the `realmMatch` data key and never
51
+ * consults a column name, so this can never change an evaluate() outcome.
52
+ */
53
+ readonly realmAttributeName?: string;
42
54
  };
43
55
  export type PolicyEvaluationContextInput = Partial<PolicyEvaluationContext>;
44
56
  //#endregion
@@ -322,22 +334,6 @@ export declare class IdentityPolicyEvaluator implements IPolicyEvaluator {
322
334
  evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
323
335
  }
324
336
  //#endregion
325
- //#region src/policy/built-in/permission-binding/types.d.ts
326
- export interface PermissionBindingPolicy extends BasePolicy {}
327
- //#endregion
328
- //#region src/policy/built-in/permission-binding/validator.d.ts
329
- export declare class PermissionBindingPolicyValidator extends Container<PermissionBindingPolicy> {
330
- initialize(): void;
331
- }
332
- //#endregion
333
- //#region src/policy/built-in/permission-binding/module.d.ts
334
- export declare class PermissionBindingPolicyEvaluator implements IPolicyEvaluator {
335
- protected validator: PermissionBindingPolicyValidator;
336
- constructor();
337
- requires(): string[];
338
- evaluate(value: Record<string, any>): Promise<PolicyEvaluationResult>;
339
- }
340
- //#endregion
341
337
  //#region src/permission/realm-scope/constants.d.ts
342
338
  /**
343
339
  * Actor-relative realm reach of a permission grant.
@@ -382,6 +378,54 @@ export declare function minRealmScope(values: Array<`${RealmScope}` | null | und
382
378
  */
383
379
  export declare function realmScopeMatches(scope: `${RealmScope}` | null | undefined, resourceRealmId: string | string[] | null | undefined, identityRealmId: string | null | undefined, identityRealmName?: string | null): boolean;
384
380
  //#endregion
381
+ //#region src/permission/types.d.ts
382
+ export type BasePermission = {
383
+ name: string;
384
+ clientId?: string | null;
385
+ realmId?: string | null;
386
+ decisionStrategy?: `${DecisionStrategy}` | null;
387
+ };
388
+ /**
389
+ * A raw permission grant: one permission with its policies and realm reach, as loaded from a
390
+ * role/identity junction. `aggregatePermissionPolicyBindings` groups these per permission into
391
+ * a `PermissionPolicyBindingAggregated` (the lossless disjunction of grants).
392
+ */
393
+ export type PermissionPolicyBinding = {
394
+ permission: BasePermission;
395
+ policies?: BasePolicy[];
396
+ /**
397
+ * Relative realm reach of this grant (none/own/ownOrNull/any). Absent coerces to the
398
+ * most restrictive `own` (fail-closed). NOT part of the binding identity key
399
+ * (see isPermissionPolicyBindingEqual).
400
+ */
401
+ realmScope?: `${RealmScope}`;
402
+ };
403
+ /**
404
+ * One disjunction term of an aggregated binding: a single grant's realm reach paired with its
405
+ * own (single) policy. A disjunction-aware consumer ORs `realmScopeMatches(realmScope) ∧ policy`
406
+ * across the grants of a permission.
407
+ */
408
+ export type PermissionGrant = {
409
+ /** Relative realm reach (none/own/ownOrNull/any), normalized — fail-closed default `own`. */
410
+ realmScope: `${RealmScope}`;
411
+ /**
412
+ * The grant's policy: the raw junction policy (its `id` preserved, for propagation) for a
413
+ * single-policy grant, a composite for a multi-policy (Layer-1) binding, or `undefined`
414
+ * when the grant carries no restriction.
415
+ */
416
+ policy?: BasePolicy;
417
+ };
418
+ /**
419
+ * A permission together with the actor's disjunction of grants for it. Output of
420
+ * `aggregatePermissionPolicyBindings` — the honest, lossless replacement for the collapsed
421
+ * `PermissionPolicyBinding` (no top-level realmScope/policies; the access decision is the
422
+ * OR over `grants`).
423
+ */
424
+ export type PermissionPolicyBindingAggregated = {
425
+ permission: BasePermission;
426
+ grants: PermissionGrant[];
427
+ };
428
+ //#endregion
385
429
  //#region src/policy/built-in/realm-match/types.d.ts
386
430
  export interface RealmMatchPolicy extends BasePolicy {
387
431
  /**
@@ -438,6 +482,37 @@ export declare class RealmMatchPolicyEvaluator implements IPolicyEvaluator {
438
482
  evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
439
483
  }
440
484
  //#endregion
485
+ //#region src/policy/built-in/permission-binding/types.d.ts
486
+ export interface PermissionBindingPolicy extends BasePolicy {}
487
+ //#endregion
488
+ //#region src/policy/built-in/permission-binding/validator.d.ts
489
+ export declare class PermissionBindingPolicyValidator extends Container<PermissionBindingPolicy> {
490
+ initialize(): void;
491
+ }
492
+ //#endregion
493
+ //#region src/policy/built-in/permission-binding/identity-evaluator.d.ts
494
+ type IdentityPermissionProvider = {
495
+ getFor(identity: IdentityPolicyData): Promise<PermissionPolicyBinding[]>;
496
+ };
497
+ export declare class IdentityPermissionBindingPolicyEvaluator implements IPolicyEvaluator {
498
+ protected validator: PermissionBindingPolicyValidator;
499
+ protected identityEvaluator: IdentityPolicyEvaluator;
500
+ protected realmMatchEvaluator: RealmMatchPolicyEvaluator;
501
+ protected identityPermissionProvider: IdentityPermissionProvider;
502
+ constructor(identityPermissionProvider: IdentityPermissionProvider);
503
+ requires(): string[];
504
+ accessData(ctx: PolicyEvaluationContext): Promise<PermissionPolicyBindingAggregated | null>;
505
+ evaluate(value: Record<string, any>, ctx: PolicyEvaluationContext): Promise<PolicyEvaluationResult>;
506
+ }
507
+ //#endregion
508
+ //#region src/policy/built-in/permission-binding/module.d.ts
509
+ export declare class PermissionBindingPolicyEvaluator implements IPolicyEvaluator {
510
+ protected validator: PermissionBindingPolicyValidator;
511
+ constructor();
512
+ requires(): string[];
513
+ evaluate(value: Record<string, any>): Promise<PolicyEvaluationResult>;
514
+ }
515
+ //#endregion
441
516
  //#region src/policy/built-in/time/constants.d.ts
442
517
  export declare enum TimePolicyInterval {
443
518
  DAILY = "daily",
@@ -603,54 +678,6 @@ export declare class PermissionError extends AuthupError {
603
678
  //#region src/permission/error/check.d.ts
604
679
  export declare function isPermissionError(input: unknown): input is PermissionError;
605
680
  //#endregion
606
- //#region src/permission/types.d.ts
607
- export type BasePermission = {
608
- name: string;
609
- clientId?: string | null;
610
- realmId?: string | null;
611
- decisionStrategy?: `${DecisionStrategy}` | null;
612
- };
613
- /**
614
- * A raw permission grant: one permission with its policies and realm reach, as loaded from a
615
- * role/identity junction. `aggregatePermissionPolicyBindings` groups these per permission into
616
- * a `PermissionPolicyBindingAggregated` (the lossless disjunction of grants).
617
- */
618
- export type PermissionPolicyBinding = {
619
- permission: BasePermission;
620
- policies?: BasePolicy[];
621
- /**
622
- * Relative realm reach of this grant (none/own/ownOrNull/any). Absent coerces to the
623
- * most restrictive `own` (fail-closed). NOT part of the binding identity key
624
- * (see isPermissionPolicyBindingEqual).
625
- */
626
- realmScope?: `${RealmScope}`;
627
- };
628
- /**
629
- * One disjunction term of an aggregated binding: a single grant's realm reach paired with its
630
- * own (single) policy. A disjunction-aware consumer ORs `realmScopeMatches(realmScope) ∧ policy`
631
- * across the grants of a permission.
632
- */
633
- export type PermissionGrant = {
634
- /** Relative realm reach (none/own/ownOrNull/any), normalized — fail-closed default `own`. */
635
- realmScope: `${RealmScope}`;
636
- /**
637
- * The grant's policy: the raw junction policy (its `id` preserved, for propagation) for a
638
- * single-policy grant, a composite for a multi-policy (Layer-1) binding, or `undefined`
639
- * when the grant carries no restriction.
640
- */
641
- policy?: BasePolicy;
642
- };
643
- /**
644
- * A permission together with the actor's disjunction of grants for it. Output of
645
- * `aggregatePermissionPolicyBindings` — the honest, lossless replacement for the collapsed
646
- * `PermissionPolicyBinding` (no top-level realmScope/policies; the access decision is the
647
- * OR over `grants`).
648
- */
649
- export type PermissionPolicyBindingAggregated = {
650
- permission: BasePermission;
651
- grants: PermissionGrant[];
652
- };
653
- //#endregion
654
681
  //#region src/permission/helpers/aggregate.d.ts
655
682
  /**
656
683
  * Group raw permission-policy bindings by permission key into the actor's disjunction of
@@ -748,6 +775,14 @@ export type PermissionCompileContext = {
748
775
  * compiled condition ranges over.
749
776
  */
750
777
  data?: PolicyData;
778
+ /**
779
+ * Row column the realm reach is lowered onto, when the rows this compilation
780
+ * ranges over carry their realm under another name — a junction's owner-realm
781
+ * key (`roleRealmId`, `clientRealmId`, …). Default `realmId`. Affects the
782
+ * `conditional` condition only; the per-row `post` fallback still reads the
783
+ * realm from the `realmMatch` data key its caller supplies.
784
+ */
785
+ realmAttributeName?: string;
751
786
  };
752
787
  /**
753
788
  * Outcome of compiling a permission's policy trees against the knowns bag
@@ -799,4 +834,381 @@ export declare class PermissionEvaluator implements IPermissionEvaluator {
799
834
  compile(ctx: PermissionCompileContext): Promise<PermissionCompileResult>;
800
835
  }
801
836
  //#endregion
837
+ //#region src/permission/authorization/error.d.ts
838
+ export declare const AUTHORIZATION_CATALOG_STALE_ERROR_INSTANCE: unique symbol;
839
+ /**
840
+ * A grant references a definition or a policy the supplied catalog does not
841
+ * carry: the caller's cached catalog predates the definition or the junction
842
+ * row and must be refetched. A definition the catalog carries with
843
+ * `policies: null`, and one whose tree this copy cannot project, are not
844
+ * stale but unevaluable, and a grant of either is dropped.
845
+ *
846
+ * Recognize it with `isAuthorizationCatalogStaleError`, never `instanceof`:
847
+ * this package is a plain caret dependency of several workspaces, so a
848
+ * consumer tree may resolve two copies of it and turn the one recoverable
849
+ * state into an unrecoverable one.
850
+ */
851
+ export declare class AuthorizationCatalogStaleError extends AuthupError {
852
+ constructor(message: string);
853
+ }
854
+ //#endregion
855
+ //#region src/permission/authorization/check.d.ts
856
+ /**
857
+ * Marker-only: the error carries no code of its own, and it never crosses a
858
+ * wire boundary, so there is no shape to fall back to.
859
+ */
860
+ export declare function isAuthorizationCatalogStaleError(input: unknown): input is AuthorizationCatalogStaleError;
861
+ //#endregion
862
+ //#region src/permission/authorization/types.d.ts
863
+ /**
864
+ * One policy tree node as it travels: the type's configuration keys (the output
865
+ * of that type's validator), `invert`, and for a composite its children inline.
866
+ */
867
+ export type AuthorizationPolicy = {
868
+ type: string;
869
+ invert?: boolean | null;
870
+ children?: AuthorizationPolicy[];
871
+ [key: string]: unknown;
872
+ };
873
+ export type AuthorizationDefinition = {
874
+ name: string;
875
+ realm_id: string | null;
876
+ client_id: string | null;
877
+ decision_strategy: `${DecisionStrategy}` | null;
878
+ /**
879
+ * The definition layer: the ids of the policy trees bound to the permission
880
+ * definition (`auth_permission_policies`). Empty means unrestricted at this
881
+ * layer. `null` means the server could not project one of those trees onto
882
+ * the wire (a policy type the catalog does not carry, or a configuration
883
+ * its validator refuses): the definition exists, a consumer cannot evaluate
884
+ * it and denies it, dropping every grant of it, until the policy is fixed.
885
+ */
886
+ policies: string[] | null;
887
+ };
888
+ /**
889
+ * Identity-free and cacheable: every permission definition with its policy trees.
890
+ */
891
+ export type AuthorizationCatalog = {
892
+ /**
893
+ * Every policy tree a definition or a grant can name, keyed by the tree's
894
+ * own id and present exactly once however many of them reference it.
895
+ */
896
+ policies: Record<string, AuthorizationPolicy>;
897
+ permissions: AuthorizationDefinition[];
898
+ };
899
+ /**
900
+ * One raw grant of an identity as the introspection endpoints report it: the
901
+ * permission namespace it names, its realm reach and the junction policy ids.
902
+ * Structurally the extended `OAuth2TokenPermission` of `@authup/specs` (this
903
+ * package does not depend on specs).
904
+ */
905
+ export type AuthorizationGrant = {
906
+ name: string;
907
+ realm_id?: string | null;
908
+ client_id?: string | null;
909
+ /**
910
+ * Absent or null coerces to `own`, fail-closed.
911
+ */
912
+ realm_scope?: `${RealmScope}` | null;
913
+ /**
914
+ * Absent or null means no junction policy.
915
+ */
916
+ policies?: string[] | null;
917
+ };
918
+ export type AuthorizationEvaluatorInput = {
919
+ /**
920
+ * An `AuthorizationCatalog`, validated by the schema.
921
+ */
922
+ catalog: unknown;
923
+ /**
924
+ * `AuthorizationGrant[]`, validated by the schema. Defaults to none, and
925
+ * may only be supplied together with the identity holding them.
926
+ */
927
+ grants?: unknown;
928
+ /**
929
+ * The identity the grants belong to. Omitted for an anonymous caller:
930
+ * no identity data is injected and no grant is bound, so only a
931
+ * definition whose policies need no identity can pass.
932
+ */
933
+ identity?: IdentityPolicyData;
934
+ };
935
+ /**
936
+ * Which resource realms a batch check evaluates against.
937
+ *
938
+ * A string is SYMBOLIC and resolved server-side against the caller's own
939
+ * identity: `own` is the realm the identity belongs to, `ownOrNull` is that
940
+ * realm plus `null`, the global rows every realm shares. An array is taken
941
+ * VERBATIM: the server resolves no realm key, so it discloses no realm's
942
+ * existence and the caller matches the answer against its own input with no
943
+ * resolution step of its own.
944
+ *
945
+ * String versus array is what discriminates the two forms, so `own` stays
946
+ * unambiguous even though it is a legal realm name.
947
+ */
948
+ export type AuthorizationCheckRealms = `${RealmScope.OWN}` | `${RealmScope.OWN_OR_NULL}` | Array<string | null>;
949
+ /**
950
+ * One permission the identity may attempt, and the requested realms it may
951
+ * attempt it in. Never empty: a permission reaching no requested realm is
952
+ * absent from the answer entirely, so absent means denied.
953
+ */
954
+ export type AuthorizationCheckPermission = {
955
+ name: string;
956
+ realms: Array<string | null>;
957
+ };
958
+ /**
959
+ * The answer `POST /authorization/check` serves: the caller's own verdicts,
960
+ * paired with the realms they hold in.
961
+ *
962
+ * It is an upper bound on what may be ATTEMPTED rather than an entitlement,
963
+ * the same posture the catalog and `GET /schemas` take: it is a pre-gate, so a
964
+ * grant whose junction policy needs a resource row passes here and is still
965
+ * decided per row on the server, which stays the enforcement point.
966
+ */
967
+ export type AuthorizationCheckPermissions = AuthorizationCheckPermission[];
968
+ export type AuthorizationCheckEvaluatorInput = {
969
+ /**
970
+ * An `AuthorizationCheckPermissions`, validated by the schema.
971
+ */
972
+ permissions: unknown;
973
+ /**
974
+ * The identity the verdicts belong to, used to resolve a `realmMatch` of
975
+ * `own` shape: a resource realm equal to this identity's realm id or name
976
+ * is the identity's own realm. Omitted for an anonymous caller, which
977
+ * holds no verdict at all.
978
+ */
979
+ identity?: IdentityPolicyData;
980
+ };
981
+ //#endregion
982
+ //#region src/permission/authorization/check-schema.d.ts
983
+ /**
984
+ * The whole input `createAuthorizationCheckEvaluator` takes: the answer
985
+ * `POST /authorization/check` served and the identity it belongs to. Same
986
+ * validup-over-zod shape as the catalog's input, so a consumer can override
987
+ * one member's rules instead of restating the answer.
988
+ */
989
+ export declare class AuthorizationCheckEvaluatorInputValidator extends Container<AuthorizationCheckEvaluatorInput> {
990
+ initialize(): void;
991
+ }
992
+ export type AuthorizationCheckEvaluatorInputParsed = {
993
+ permissions: AuthorizationCheckPermissions;
994
+ identity: AuthorizationCheckEvaluatorInput['identity'];
995
+ };
996
+ /**
997
+ * Validate the check evaluator's input, plus the one rule a per-key validator
998
+ * cannot express: a permission namespace appears at most once. Two entries for
999
+ * one name would make the answer depend on which the consumer looked up first,
1000
+ * and the server emits one entry per name by construction.
1001
+ */
1002
+ export declare function parseAuthorizationCheckEvaluatorInput(input: AuthorizationCheckEvaluatorInput): Promise<AuthorizationCheckEvaluatorInputParsed>;
1003
+ //#endregion
1004
+ //#region src/permission/authorization/constants.d.ts
1005
+ /**
1006
+ * The node a policy tree travels as when the server withholds it, because the
1007
+ * caller's realm reach does not cover the row it was read from.
1008
+ *
1009
+ * It is deliberately a type no consumer can project: `projectAuthorizationPolicy`
1010
+ * refuses it, which is already the state a definition referencing it denies
1011
+ * through and a grant naming it is dropped through, so withholding a body needs
1012
+ * no rule of its own on the consumer side. That is a contract between the two
1013
+ * halves rather than a server detail, which is why it is declared HERE, next to
1014
+ * the projection that has to keep refusing it, and pinned by this package's own
1015
+ * test.
1016
+ */
1017
+ export declare const AUTHORIZATION_POLICY_WITHHELD_TYPE = "withheld";
1018
+ //#endregion
1019
+ //#region src/permission/authorization/module.d.ts
1020
+ /**
1021
+ * Build a resource-server (or console) evaluator from the catalog
1022
+ * `GET /authorization` serves, the identity's grants as the introspection
1023
+ * endpoints report them, and the identity itself. Rejects legacy, incomplete
1024
+ * and unsupported input. A grant referencing a definition or a policy the
1025
+ * catalog lacks throws `AuthorizationCatalogStaleError`, the signal to
1026
+ * refetch the catalog: the grants come from a fresh introspection while the
1027
+ * catalog may predate the definition or the junction row. A definition the
1028
+ * server could not project travels with `policies: null` instead of being
1029
+ * left out, so a grant of it is dropped rather than reported stale: the
1030
+ * definition layer cannot be evaluated here, a refetch changes nothing, and
1031
+ * the permission denies until the policy is fixed.
1032
+ *
1033
+ * A tree THIS copy cannot project is the same condition read from the other
1034
+ * side, and it is per tree: a policy type newer than this package (the
1035
+ * built-in type enum is closed while the column is a free string) or a
1036
+ * configuration its validator refuses denies the definitions that reference
1037
+ * it, exactly as `policies: null` does, and drops a grant that names it,
1038
+ * exactly as a binding check does. One such tree never takes the evaluator
1039
+ * down for the permissions that do not use it. A malformed catalog still
1040
+ * throws: a duplicate permission namespace is not a data condition.
1041
+ *
1042
+ * Both the identity and the grants are optional. Without an identity no grant
1043
+ * is bound and any IDENTITY key the caller supplied is REMOVED, so the
1044
+ * binding evaluator answers with missing data exactly as the server does for
1045
+ * an anonymous request, only a definition whose policies need no identity can
1046
+ * pass, and a caller can never inject an identity the document did not prove.
1047
+ * Grants without the identity they belong to are refused.
1048
+ *
1049
+ * The REALM_MATCH data key follows the server's own three-way rule: a
1050
+ * resource that carries a realm passes it (null for a global row, which
1051
+ * `own` denies), a resource with no realm dimension passes nothing and reach
1052
+ * neutral-passes. `preEvaluate` / `preEvaluateOneOf` are the pre-gate and
1053
+ * enforce reach only when that key is present. `compile` returns the
1054
+ * allow/deny/conditional/post contract; a `post` collection query must be
1055
+ * rejected or evaluated over every candidate before paging. The supplied
1056
+ * identity is authoritative; `options.decisionStrategy` is forwarded and the
1057
+ * policy include, exclude and pending options are refused.
1058
+ */
1059
+ export declare function createAuthorizationEvaluator(input: AuthorizationEvaluatorInput): Promise<IPermissionEvaluator>;
1060
+ /**
1061
+ * An `IPermissionEvaluator` over the answer `POST /authorization/check`
1062
+ * served: the caller's own verdicts, paired with the realms they hold in.
1063
+ *
1064
+ * It is what a PUBLIC client gets where the catalog is out of reach. A public
1065
+ * client holds no secret, so it can obtain no `client_credentials` token and
1066
+ * has no credential of its own for the catalog's gate to be satisfied by;
1067
+ * publishing every policy predicate to it instead would be the wrong trade.
1068
+ * The verdicts are computed by the server from the same grants and the same
1069
+ * evaluators a request runs, so this is authoritative where the name-only
1070
+ * fallback it replaces is merely coarse.
1071
+ *
1072
+ * Two properties follow from the answer being a pre-gate:
1073
+ *
1074
+ * It is an UPPER BOUND, so `evaluate` and `evaluateOneOf` answer exactly what
1075
+ * the pre-gate pair answers. A check that depends on a resource row belongs to
1076
+ * whoever holds the row, and the server decides it there; answering such a
1077
+ * check here would mean inventing a verdict. That is the same bound the
1078
+ * name-only fallback already had, so nothing that gates on it loosens.
1079
+ *
1080
+ * And a resource realm is matched against what the REQUEST asked about: a
1081
+ * `realmMatch` naming a realm the request never carried is in no entry's list
1082
+ * and therefore denies. That is fail-closed by construction rather than by a
1083
+ * rule, and it is why a caller must ask about the realms its UI will ask
1084
+ * about.
1085
+ */
1086
+ export declare function createAuthorizationCheckEvaluator(input: AuthorizationCheckEvaluatorInput): Promise<IPermissionEvaluator>;
1087
+ //#endregion
1088
+ //#region src/permission/authorization/policy.d.ts
1089
+ /**
1090
+ * The one definition of what a policy looks like on the wire, used by the server
1091
+ * to build a document and by the consumer to validate one. A node is the OUTPUT
1092
+ * of its type's validator (validup strips every unmounted key, so entity columns
1093
+ * such as `id`, `name`, `builtIn` or `createdAt` never travel), plus its type
1094
+ * and, for a composite, its projected children.
1095
+ *
1096
+ * Every refusal is a `ValidupError`, the node's head and the type's own
1097
+ * validator alike, and a child's issues are rebased onto the position it sits
1098
+ * at, so one message names the node in the tree that is wrong.
1099
+ */
1100
+ export declare function projectAuthorizationPolicy(input: unknown): Promise<AuthorizationPolicy>;
1101
+ /**
1102
+ * Whether a projected tree evaluates the permission binding at any depth. A
1103
+ * grant policy carrying one would re-enter its own permission's grants, so
1104
+ * `createAuthorizationEvaluator` drops the grant that names it and evaluates
1105
+ * the permission from the rest. Its one caller is that consumer: the tree is
1106
+ * legal in a definition, where the binding check is what reach is enforced
1107
+ * by, so the producer carries it and only the grant side is refused.
1108
+ */
1109
+ export declare function containsBindingCheck(policy: AuthorizationPolicy): boolean;
1110
+ //#endregion
1111
+ //#region src/permission/authorization/schema.d.ts
1112
+ /**
1113
+ * A policy node as it travels. Deliberately LOOSE: every key beyond `type` is
1114
+ * that type's own configuration, and `projectAuthorizationPolicy` is what
1115
+ * validates it, by running the type's own validator. Mounting a node in a
1116
+ * validup container would strip every key the container does not mount, and
1117
+ * the whole configuration would go with it.
1118
+ */
1119
+ export declare const authorizationPolicySchema: z.ZodObject<{
1120
+ type: z.ZodString;
1121
+ }, z.core.$loose>;
1122
+ /**
1123
+ * One permission definition. `policies` carries the ids of its
1124
+ * definition-layer trees, or `null` when the server could not project one.
1125
+ */
1126
+ export declare const authorizationDefinitionSchema: z.ZodObject<{
1127
+ name: z.ZodString;
1128
+ realm_id: z.ZodNullable<z.ZodString>;
1129
+ client_id: z.ZodNullable<z.ZodString>;
1130
+ decision_strategy: z.ZodNullable<z.ZodEnum<typeof DecisionStrategy>>;
1131
+ policies: z.ZodNullable<z.ZodArray<z.ZodString>>;
1132
+ }, z.core.$strip>;
1133
+ export declare const authorizationCatalogSchema: z.ZodObject<{
1134
+ policies: z.ZodRecord<z.ZodString, z.ZodObject<{
1135
+ type: z.ZodString;
1136
+ }, z.core.$loose>>;
1137
+ permissions: z.ZodArray<z.ZodObject<{
1138
+ name: z.ZodString;
1139
+ realm_id: z.ZodNullable<z.ZodString>;
1140
+ client_id: z.ZodNullable<z.ZodString>;
1141
+ decision_strategy: z.ZodNullable<z.ZodEnum<typeof DecisionStrategy>>;
1142
+ policies: z.ZodNullable<z.ZodArray<z.ZodString>>;
1143
+ }, z.core.$strip>>;
1144
+ }, z.core.$strip>;
1145
+ /**
1146
+ * One grant of the identity, as the introspection endpoints report it.
1147
+ * Whether a grant's policy ids are declared is checked against the catalog
1148
+ * the consumer holds, since the two travel separately.
1149
+ */
1150
+ export declare const authorizationGrantSchema: z.ZodObject<{
1151
+ name: z.ZodString;
1152
+ realm_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1153
+ client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1154
+ realm_scope: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof RealmScope>>>;
1155
+ policies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1156
+ }, z.core.$strip>;
1157
+ export declare const authorizationIdentitySchema: z.ZodObject<{
1158
+ id: z.ZodString;
1159
+ type: z.ZodEnum<{
1160
+ user: "user";
1161
+ client: "client";
1162
+ }>;
1163
+ realmId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1164
+ realmName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1165
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1166
+ }, z.core.$strip>;
1167
+ /**
1168
+ * The whole input `createAuthorizationEvaluator` takes: the catalog
1169
+ * `GET /authorization` serves, the grants an introspection reports and the
1170
+ * identity it names. A validup container over zod mounts, the shape every
1171
+ * validator in this package uses, so a consumer can reuse or override one
1172
+ * member's rules instead of restating the document.
1173
+ */
1174
+ export declare class AuthorizationEvaluatorInputValidator extends Container<AuthorizationEvaluatorInput> {
1175
+ initialize(): void;
1176
+ }
1177
+ export type AuthorizationEvaluatorInputParsed = {
1178
+ catalog: AuthorizationCatalog;
1179
+ grants: AuthorizationGrant[];
1180
+ identity: AuthorizationEvaluatorInput['identity'];
1181
+ };
1182
+ /**
1183
+ * Validate the evaluator's input, plus the two rules per-key validators
1184
+ * cannot express.
1185
+ *
1186
+ * Every id a definition names must be a key of `policies`: a dangling id
1187
+ * resolves to `undefined`, which reads as "this layer carries no policy", so
1188
+ * a catalog that merely omitted a tree would grant unrestricted access rather
1189
+ * than fail. The lookup is own-property only, so an id such as `constructor`
1190
+ * cannot be answered by a member of `Object.prototype`.
1191
+ *
1192
+ * And the identity and its grants travel together: grants without an identity
1193
+ * belong to nobody, while an identity without a grant list is the shape an
1194
+ * INACTIVE introspection produces (`permissions` is absent unless the
1195
+ * credential is active), which read as "holds nothing" would authorize every
1196
+ * definition that carries no binding check. An identity holding no grant says
1197
+ * so with an empty array.
1198
+ */
1199
+ export declare function parseAuthorizationEvaluatorInput(input: AuthorizationEvaluatorInput): Promise<AuthorizationEvaluatorInputParsed>;
1200
+ /**
1201
+ * One verdict: the permission namespace and the requested realms it holds in.
1202
+ * A realm value is a realm key the caller itself supplied, or `null` for the
1203
+ * global rows, so nothing here is resolved or looked up.
1204
+ */
1205
+ export declare const authorizationCheckPermissionSchema: z.ZodObject<{
1206
+ name: z.ZodString;
1207
+ realms: z.ZodArray<z.ZodNullable<z.ZodString>>;
1208
+ }, z.core.$strip>;
1209
+ export declare const authorizationCheckPermissionsSchema: z.ZodArray<z.ZodObject<{
1210
+ name: z.ZodString;
1211
+ realms: z.ZodArray<z.ZodNullable<z.ZodString>>;
1212
+ }, z.core.$strip>>;
1213
+ //#endregion
802
1214
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/policy/data.ts","../src/policy/evaluation/context/types.ts","../src/policy/evaluation/context/define.ts","../src/policy/evaluation/types.ts","../src/policy/types.ts","../src/policy/engine/types.ts","../src/policy/engine/module.ts","../src/policy/issue/constants.ts","../src/policy/issue/types.ts","../src/policy/issue/define.ts","../src/policy/error/module.ts","../src/policy/error/check.ts","../src/policy/helpers/invert.ts","../src/policy/built-in/attribute-names/types.ts","../src/policy/built-in/attribute-names/validator.ts","../src/policy/built-in/attributes/types.ts","../src/policy/built-in/attributes/define.ts","../src/policy/built-in/attributes/validator.ts","../src/policy/built-in/attributes/evaluator.ts","../src/policy/built-in/attribute-names/evaluator.ts","../src/policy/built-in/composite/types.ts","../src/policy/built-in/composite/validator.ts","../src/policy/built-in/composite/evaluator.ts","../src/policy/built-in/composite/helper.ts","../src/policy/built-in/date/types.ts","../src/policy/built-in/date/validator.ts","../src/policy/built-in/date/evaluator.ts","../src/policy/built-in/identity/types.ts","../src/policy/built-in/identity/data/validator.ts","../src/policy/built-in/identity/validator.ts","../src/policy/built-in/identity/evaluator.ts","../src/policy/built-in/permission-binding/types.ts","../src/policy/built-in/permission-binding/validator.ts","../src/policy/built-in/permission-binding/module.ts","../src/permission/realm-scope/constants.ts","../src/permission/realm-scope/helpers.ts","../src/policy/built-in/realm-match/types.ts","../src/policy/built-in/realm-match/validator.ts","../src/policy/built-in/realm-match/evaluator.ts","../src/policy/built-in/time/constants.ts","../src/policy/built-in/time/types.ts","../src/policy/built-in/time/validator.ts","../src/policy/built-in/time/evaluator.ts","../src/policy/built-in/time/helpers.ts","../src/policy/built-in/constants.ts","../src/policy/built-in/types.ts","../src/policy/built-in/define.ts","../src/policy/constants.ts","../src/policy/input.ts","../src/permission/error/module.ts","../src/permission/error/check.ts","../src/permission/types.ts","../src/permission/helpers/aggregate.ts","../src/permission/helpers/equal.ts","../src/permission/helpers/grant.ts","../src/permission/helpers/key.ts","../src/permission/provider/types.ts","../src/permission/provider/memory.ts","../src/permission/evaluator/types.ts","../src/permission/evaluator/module.ts"],"mappings":";;;;;;;iBAOiB;EACb,IAAI,aAAa;EACjB,IAAI;EACJ,IAAI,aAAa,cAAe;EAEhC,YAAY;EACZ,aAAa;EAEb,SAAU;;qBAGD,sBAAsB;YACrB,MAAM;YAEN,WAAY;EAGlB,YAAA,OAAM,qBACN,YAAW;EAMf,IAAI,aAAa,aAAa,OAAO;EAKrC,IAAI,aAAa,cAAe;EAQhC,IAAI;EAIJ,aAAa;EAIb,YAAY;EAIZ,SAAK;;;;YC/CG;WACC,YAAY,eAAe;WAC3B;WACA;WACA;WACA,MAAM;;;;;;;WAON;;YAGD,+BAA+B,QAAQ;;;wBCdnC,8BACZ,QAAO,+BACP;;;YCDQ,mBAAmB,eAAe;YAElC;EACR;;;;;;;;;EASA;;;;;;;;;;EAUA,YAAY;EACZ,SAAS;;iBAGI;;;;;;;;;;EAUb,UAAU,OAAO;;;;;;;;;;;;EAajB,aAAa,OAAO,qBAAqB,SAAS,0BAA0B,QAAQ;;;;EAKpF,SAAS,OAAO,qBAAqB,SAAS,0BAA0B,QAAQ;;;;YC1DxE,WAAW;;;;EAInB,OAAO;;;;EAKP;;YAGQ,eACR,UAAU,sBAAsB,qBAChC,6BACA,IAAI,WAAW;;;iBCZF;EACb,SAAS,QAAQ,YAAY,SAAS,0BAA2B,QAAQ;EAEzE,eAAe,QAAQ,YAAY,SAAS,0BAA2B;;;;;;;;qBC2B9D,wBAAwB;YACvB,YAAa,eAAe;EAE1B,YAAA,aAAY;EAWjB,kBACH,cACA,WAAW;EAKR,mBAAmB,YAAY;;;;;EAWhC,SAAS,QAAQ,YAAY,KAAK,0BAA2B,QAAQ;EAoHrE,eAAe,QAAQ,YAAY,KAAK,0BAA2B;;;;oBCrLjE;EACR;EACA;;oBAGQ;EAER;EACA;EAGA;EACA;EAC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;YAQd;EACR,YAAY;EACZ,WAAW;;;;;;EAMX,gBAAgB;;;;;;;YAQR;;EAER,eAAe;;;;;;EAMf,SAAS;;;;;;;;YASD;EACR,YAAY;EACZ,QAAQ;;;;;;;;;;;wBCJI,kCACZ,OAAO,4BACR;;;wBC/Ca,+BACZ;EAAK,YAAY;GACjB;EAAK,YAAY;;;;;;;;;;wBC+GL,eAAe,QAAQ,iBAAiB,OAAO;;;wBC5G/C,mBACZ,OAAO;;;YCNC;EACR;EACA;EACA;;iBAGa;EACb,QAAQ,UAAU,uBAAwB,QAAQ;;;;qBCLzC,oCAAoC;YACnC,OAAQ,eAAe;EAErB,YAAA,QAAO;EAIb,QACF,SAAS,uBACV,QAAQ;EAeX,QAAQ,OAAO;;;;iBCvBF;EACb,SAAS,KAAK,8BAA8B;EAE5C,cAAc,KAAK,8BAA8B;EAEjD,YAAY,KAAK,8BAA8B;EAE/C,iBAAiB,KAAK,8BAA8B;EAEpD,QAAQ,KAAK,2BAA2B,QAAQ;;YAGxC;EACR,UAAU;EACV,eAAe;EACf;EACA;;YAGQ;EACR,sBAAsB;EACtB;EACA;;;;;;;;;;EAUA;;YAGQ;EACR;EACA;EACA;EACA,OAAO;EACP,UAAU;;YAGF;;;;;EAKR;EACA;EACA;;;;;;EAMA,OAAO;;;;;;;;;;;;;YAcC;EAA4B;;EAClC;;EACA;EAAwB,WAAW;;EACnC;;;;qBCnDO,+BAA+B;YAC9B,UAAW;YAEX,cAAe;YAEf;YAEA;EAIE,YAAA,SAAS;YAeL,QACZ,eACA;IACI;IACA;MAEJ,QAAQ;EAUN,SAAS,KAAK,8BAA+B;EAqH7C,cAAc,KAAK,8BAA+B;EAYlD,YAAY,KAAK,8BAA+B;EAehD,iBAAiB,KAAK,8BAA+B;;;;;;;;;;;EAsBrD,QAAQ,KAAK,2BAA4B,QAAQ"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/policy/data.ts","../src/policy/evaluation/context/types.ts","../src/policy/evaluation/context/define.ts","../src/policy/evaluation/types.ts","../src/policy/types.ts","../src/policy/engine/types.ts","../src/policy/engine/module.ts","../src/policy/issue/constants.ts","../src/policy/issue/types.ts","../src/policy/issue/define.ts","../src/policy/error/module.ts","../src/policy/error/check.ts","../src/policy/helpers/invert.ts","../src/policy/built-in/attribute-names/types.ts","../src/policy/built-in/attribute-names/validator.ts","../src/policy/built-in/attributes/types.ts","../src/policy/built-in/attributes/define.ts","../src/policy/built-in/attributes/validator.ts","../src/policy/built-in/attributes/evaluator.ts","../src/policy/built-in/attribute-names/evaluator.ts","../src/policy/built-in/composite/types.ts","../src/policy/built-in/composite/validator.ts","../src/policy/built-in/composite/evaluator.ts","../src/policy/built-in/composite/helper.ts","../src/policy/built-in/date/types.ts","../src/policy/built-in/date/validator.ts","../src/policy/built-in/date/evaluator.ts","../src/policy/built-in/identity/types.ts","../src/policy/built-in/identity/data/validator.ts","../src/policy/built-in/identity/validator.ts","../src/policy/built-in/identity/evaluator.ts","../src/permission/realm-scope/constants.ts","../src/permission/realm-scope/helpers.ts","../src/permission/types.ts","../src/policy/built-in/realm-match/types.ts","../src/policy/built-in/realm-match/validator.ts","../src/policy/built-in/realm-match/evaluator.ts","../src/policy/built-in/permission-binding/types.ts","../src/policy/built-in/permission-binding/validator.ts","../src/policy/built-in/permission-binding/identity-evaluator.ts","../src/policy/built-in/permission-binding/module.ts","../src/policy/built-in/time/constants.ts","../src/policy/built-in/time/types.ts","../src/policy/built-in/time/validator.ts","../src/policy/built-in/time/evaluator.ts","../src/policy/built-in/time/helpers.ts","../src/policy/built-in/constants.ts","../src/policy/built-in/types.ts","../src/policy/built-in/define.ts","../src/policy/constants.ts","../src/policy/input.ts","../src/permission/error/module.ts","../src/permission/error/check.ts","../src/permission/helpers/aggregate.ts","../src/permission/helpers/equal.ts","../src/permission/helpers/grant.ts","../src/permission/helpers/key.ts","../src/permission/provider/types.ts","../src/permission/provider/memory.ts","../src/permission/evaluator/types.ts","../src/permission/evaluator/module.ts","../src/permission/authorization/error.ts","../src/permission/authorization/check.ts","../src/permission/authorization/types.ts","../src/permission/authorization/check-schema.ts","../src/permission/authorization/constants.ts","../src/permission/authorization/module.ts","../src/permission/authorization/policy.ts","../src/permission/authorization/schema.ts"],"mappings":";;;;;;;;iBAOiB;EACb,IAAI,aAAa;EACjB,IAAI;EACJ,IAAI,aAAa,cAAe;EAChC,OAAO;EAEP,YAAY;EACZ,aAAa;EAEb,SAAU;;qBAGD,sBAAsB;YACrB,MAAM;YAEN,WAAY;EAGlB,YAAA,OAAM,qBACN,YAAW;EAMf,IAAI,aAAa,aAAa,OAAO;EAKrC,IAAI,aAAa,cAAe;EAQhC,IAAI;EAIJ,OAAO;EAKP,aAAa;EAIb,YAAY;EAIZ,SAAK;;;;YCrDG;WACC,YAAY,eAAe;WAC3B;WACA;WACA;WACA,MAAM;;;;;;;WAON;;;;;;;;;WASA;;YAGD,+BAA+B,QAAQ;;;wBCvBnC,8BACZ,QAAO,+BACP;;;YCDQ,mBAAmB,eAAe;YAElC;EACR;;;;;;;;;EASA;;;;;;;;;;EAUA,YAAY;EACZ,SAAS;;iBAGI;;;;;;;;;;EAUb,UAAU,OAAO;;;;;;;;;;;;EAajB,aAAa,OAAO,qBAAqB,SAAS,0BAA0B,QAAQ;;;;EAKpF,SAAS,OAAO,qBAAqB,SAAS,0BAA0B,QAAQ;;;;YC1DxE,WAAW;;;;EAInB,OAAO;;;;EAKP;;YAGQ,eACR,UAAU,sBAAsB,qBAChC,6BACA,IAAI,WAAW;;;iBCZF;EACb,SAAS,QAAQ,YAAY,SAAS,0BAA2B,QAAQ;EAEzE,eAAe,QAAQ,YAAY,SAAS,0BAA2B;;;;;;;;qBC2B9D,wBAAwB;YACvB,YAAa,eAAe;EAE1B,YAAA,aAAY;EAWjB,kBACH,cACA,WAAW;EAKR,mBAAmB,YAAY;;;;;EAWhC,SAAS,QAAQ,YAAY,KAAK,0BAA2B,QAAQ;EAoHrE,eAAe,QAAQ,YAAY,KAAK,0BAA2B;;;;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