@stigmer/server 3.15.2 → 3.15.3-dev.20260914100347
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/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +103 -9
- package/dist/boot/compose.js.map +1 -1
- package/dist/domain/iampolicy/access-lists.d.ts +27 -0
- package/dist/domain/iampolicy/access-lists.d.ts.map +1 -0
- package/dist/domain/iampolicy/access-lists.js +124 -0
- package/dist/domain/iampolicy/access-lists.js.map +1 -0
- package/dist/domain/iampolicy/constants.d.ts +135 -0
- package/dist/domain/iampolicy/constants.d.ts.map +1 -0
- package/dist/domain/iampolicy/constants.js +203 -0
- package/dist/domain/iampolicy/constants.js.map +1 -0
- package/dist/domain/iampolicy/controller.d.ts +29 -0
- package/dist/domain/iampolicy/controller.d.ts.map +1 -0
- package/dist/domain/iampolicy/controller.js +451 -0
- package/dist/domain/iampolicy/controller.js.map +1 -0
- package/dist/domain/iampolicy/display-resolver.d.ts +6 -0
- package/dist/domain/iampolicy/display-resolver.d.ts.map +1 -0
- package/dist/domain/iampolicy/display-resolver.js +90 -0
- package/dist/domain/iampolicy/display-resolver.js.map +1 -0
- package/dist/domain/iampolicy/grant-path.d.ts +42 -0
- package/dist/domain/iampolicy/grant-path.d.ts.map +1 -0
- package/dist/domain/iampolicy/grant-path.js +183 -0
- package/dist/domain/iampolicy/grant-path.js.map +1 -0
- package/dist/domain/iampolicy/grant-scope.d.ts +4 -0
- package/dist/domain/iampolicy/grant-scope.d.ts.map +1 -0
- package/dist/domain/iampolicy/grant-scope.js +34 -0
- package/dist/domain/iampolicy/grant-scope.js.map +1 -0
- package/dist/domain/iampolicy/membership.d.ts +111 -0
- package/dist/domain/iampolicy/membership.d.ts.map +1 -0
- package/dist/domain/iampolicy/membership.js +152 -0
- package/dist/domain/iampolicy/membership.js.map +1 -0
- package/dist/domain/iampolicy/permissions.d.ts +19 -0
- package/dist/domain/iampolicy/permissions.d.ts.map +1 -0
- package/dist/domain/iampolicy/permissions.js +27 -0
- package/dist/domain/iampolicy/permissions.js.map +1 -0
- package/dist/domain/iampolicy/resource-store.d.ts +4 -0
- package/dist/domain/iampolicy/resource-store.d.ts.map +1 -0
- package/dist/domain/iampolicy/resource-store.js +135 -0
- package/dist/domain/iampolicy/resource-store.js.map +1 -0
- package/dist/domain/iampolicy/role-lifecycle.d.ts +9 -0
- package/dist/domain/iampolicy/role-lifecycle.d.ts.map +1 -0
- package/dist/domain/iampolicy/role-lifecycle.js +106 -0
- package/dist/domain/iampolicy/role-lifecycle.js.map +1 -0
- package/dist/domain/iampolicy/roles.d.ts +11 -0
- package/dist/domain/iampolicy/roles.d.ts.map +1 -0
- package/dist/domain/iampolicy/roles.js +78 -0
- package/dist/domain/iampolicy/roles.js.map +1 -0
- package/dist/domain/iampolicy/specs.d.ts +7 -0
- package/dist/domain/iampolicy/specs.d.ts.map +1 -0
- package/dist/domain/iampolicy/specs.js +45 -0
- package/dist/domain/iampolicy/specs.js.map +1 -0
- package/dist/domain/iampolicy/steps.d.ts +18 -0
- package/dist/domain/iampolicy/steps.d.ts.map +1 -0
- package/dist/domain/iampolicy/steps.js +117 -0
- package/dist/domain/iampolicy/steps.js.map +1 -0
- package/dist/domain/iampolicy/store-contract.d.ts +8 -0
- package/dist/domain/iampolicy/store-contract.d.ts.map +1 -0
- package/dist/domain/iampolicy/store-contract.js +258 -0
- package/dist/domain/iampolicy/store-contract.js.map +1 -0
- package/dist/domain/iampolicy/store.d.ts +78 -0
- package/dist/domain/iampolicy/store.d.ts.map +1 -0
- package/dist/domain/iampolicy/store.js +13 -0
- package/dist/domain/iampolicy/store.js.map +1 -0
- package/dist/domain/iampolicy/wire-refusals.d.ts +25 -0
- package/dist/domain/iampolicy/wire-refusals.d.ts.map +1 -0
- package/dist/domain/iampolicy/wire-refusals.js +76 -0
- package/dist/domain/iampolicy/wire-refusals.js.map +1 -0
- package/dist/domain/identityaccount/constants.d.ts +33 -0
- package/dist/domain/identityaccount/constants.d.ts.map +1 -1
- package/dist/domain/identityaccount/constants.js +2 -48
- package/dist/domain/identityaccount/constants.js.map +1 -1
- package/dist/domain/identityaccount/controller.d.ts +8 -1
- package/dist/domain/identityaccount/controller.d.ts.map +1 -1
- package/dist/domain/identityaccount/controller.js +54 -29
- package/dist/domain/identityaccount/controller.js.map +1 -1
- package/dist/domain/identityaccount/operator.d.ts.map +1 -1
- package/dist/domain/identityaccount/operator.js +2 -4
- package/dist/domain/identityaccount/operator.js.map +1 -1
- package/dist/domain/identityaccount/provisioning.d.ts +20 -1
- package/dist/domain/identityaccount/provisioning.d.ts.map +1 -1
- package/dist/domain/identityaccount/provisioning.js +17 -3
- package/dist/domain/identityaccount/provisioning.js.map +1 -1
- package/dist/domain/identityaccount/resolve.d.ts +23 -0
- package/dist/domain/identityaccount/resolve.d.ts.map +1 -1
- package/dist/domain/identityaccount/resolve.js +17 -0
- package/dist/domain/identityaccount/resolve.js.map +1 -1
- package/dist/domain/identityaccount/store-contract.d.ts +4 -18
- package/dist/domain/identityaccount/store-contract.d.ts.map +1 -1
- package/dist/domain/identityaccount/store-contract.js +12 -47
- package/dist/domain/identityaccount/store-contract.js.map +1 -1
- package/dist/extensions/authorization-queries.d.ts +81 -0
- package/dist/extensions/authorization-queries.d.ts.map +1 -0
- package/dist/extensions/authorization-queries.js +2 -0
- package/dist/extensions/authorization-queries.js.map +1 -0
- package/dist/extensions/drivers.d.ts +49 -2
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/identity.d.ts +14 -0
- package/dist/extensions/identity.d.ts.map +1 -1
- package/dist/extensions/identity.js +18 -1
- package/dist/extensions/identity.js.map +1 -1
- package/dist/extensions/policy-grant-scope.d.ts +50 -0
- package/dist/extensions/policy-grant-scope.d.ts.map +1 -0
- package/dist/extensions/policy-grant-scope.js +2 -0
- package/dist/extensions/policy-grant-scope.js.map +1 -0
- package/dist/extensions/registry.d.ts +23 -1
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/extensions/registry.js +30 -0
- package/dist/extensions/registry.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +63 -0
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +56 -1
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +155 -1
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/interceptors/auth.d.ts +12 -0
- package/dist/pipeline/interceptors/auth.d.ts.map +1 -1
- package/dist/pipeline/interceptors/auth.js +13 -1
- package/dist/pipeline/interceptors/auth.js.map +1 -1
- package/dist/pipeline/steps/authorize.d.ts +20 -5
- package/dist/pipeline/steps/authorize.d.ts.map +1 -1
- package/dist/pipeline/steps/authorize.js +37 -17
- package/dist/pipeline/steps/authorize.js.map +1 -1
- package/dist/pipeline/steps/defaults.d.ts +10 -0
- package/dist/pipeline/steps/defaults.d.ts.map +1 -1
- package/dist/pipeline/steps/defaults.js +39 -0
- package/dist/pipeline/steps/defaults.js.map +1 -1
- package/dist/store/port-contract.d.ts +61 -0
- package/dist/store/port-contract.d.ts.map +1 -0
- package/dist/store/port-contract.js +67 -0
- package/dist/store/port-contract.js.map +1 -0
- package/package.json +4 -4
- package/src/boot/compose.ts +107 -10
- package/src/domain/iampolicy/__tests__/access-lists.test.ts +238 -0
- package/src/domain/iampolicy/__tests__/constants.test.ts +388 -0
- package/src/domain/iampolicy/__tests__/controller.test.ts +960 -0
- package/src/domain/iampolicy/__tests__/display-resolver.test.ts +138 -0
- package/src/domain/iampolicy/__tests__/grant-path.test.ts +474 -0
- package/src/domain/iampolicy/__tests__/grant-scope.test.ts +61 -0
- package/src/domain/iampolicy/__tests__/iampolicy.test.ts +532 -0
- package/src/domain/iampolicy/__tests__/membership.test.ts +447 -0
- package/src/domain/iampolicy/__tests__/permissions.test.ts +41 -0
- package/src/domain/iampolicy/__tests__/resource-store.test.ts +165 -0
- package/src/domain/iampolicy/__tests__/role-lifecycle.test.ts +361 -0
- package/src/domain/iampolicy/__tests__/roles.test.ts +53 -0
- package/src/domain/iampolicy/__tests__/specs.test.ts +41 -0
- package/src/domain/iampolicy/__tests__/steps.test.ts +278 -0
- package/src/domain/iampolicy/__tests__/support.ts +195 -0
- package/src/domain/iampolicy/__tests__/wire-refusals.test.ts +117 -0
- package/src/domain/iampolicy/access-lists.ts +191 -0
- package/src/domain/iampolicy/constants.ts +243 -0
- package/src/domain/iampolicy/controller.ts +798 -0
- package/src/domain/iampolicy/display-resolver.ts +123 -0
- package/src/domain/iampolicy/grant-path.ts +270 -0
- package/src/domain/iampolicy/grant-scope.ts +36 -0
- package/src/domain/iampolicy/membership.ts +298 -0
- package/src/domain/iampolicy/permissions.ts +35 -0
- package/src/domain/iampolicy/resource-store.ts +186 -0
- package/src/domain/iampolicy/role-lifecycle.ts +132 -0
- package/src/domain/iampolicy/roles.ts +95 -0
- package/src/domain/iampolicy/specs.ts +53 -0
- package/src/domain/iampolicy/steps.ts +178 -0
- package/src/domain/iampolicy/store-contract.ts +450 -0
- package/src/domain/iampolicy/store.ts +103 -0
- package/src/domain/iampolicy/wire-refusals.ts +110 -0
- package/src/domain/identityaccount/__tests__/provisioning.test.ts +19 -7
- package/src/domain/identityaccount/__tests__/resolve.test.ts +113 -2
- package/src/domain/identityaccount/constants.ts +16 -31
- package/src/domain/identityaccount/controller.ts +65 -35
- package/src/domain/identityaccount/operator.ts +5 -5
- package/src/domain/identityaccount/provisioning.ts +43 -5
- package/src/domain/identityaccount/resolve.ts +43 -0
- package/src/domain/identityaccount/store-contract.ts +22 -70
- package/src/extensions/__tests__/composed-support.ts +87 -0
- package/src/extensions/__tests__/iam-policy-composed.test.ts +373 -0
- package/src/extensions/__tests__/iam-policy-points.test.ts +169 -0
- package/src/extensions/__tests__/identity-account-composed.test.ts +12 -78
- package/src/extensions/__tests__/identity.test.ts +62 -0
- package/src/extensions/__tests__/tier-truthfulness.test.ts +8 -0
- package/src/extensions/authorization-queries.ts +97 -0
- package/src/extensions/drivers.ts +49 -2
- package/src/extensions/identity.ts +21 -0
- package/src/extensions/policy-grant-scope.ts +50 -0
- package/src/extensions/registry.ts +62 -1
- package/src/extensions/resource-authorization.ts +65 -0
- package/src/index.ts +20 -0
- package/src/pipeline/__tests__/grantable-roles-for.test.ts +87 -0
- package/src/pipeline/__tests__/kind-by-enum-name.test.ts +107 -0
- package/src/pipeline/__tests__/kind-served-by-edition.test.ts +107 -0
- package/src/pipeline/apiresource-meta.ts +181 -1
- package/src/pipeline/interceptors/auth.ts +14 -1
- package/src/pipeline/steps/__tests__/authorize-annotation-completeness.test.ts +73 -3
- package/src/pipeline/steps/__tests__/authorize.test.ts +134 -9
- package/src/pipeline/steps/__tests__/derived-id.test.ts +49 -0
- package/src/pipeline/steps/authorize.ts +46 -21
- package/src/pipeline/steps/defaults.ts +42 -0
- package/src/store/__tests__/port-contract.test.ts +123 -0
- package/src/store/port-contract.ts +102 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-authorization.d.ts","sourceRoot":"","sources":["../../src/extensions/resource-authorization.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resource-authorization.d.ts","sourceRoot":"","sources":["../../src/extensions/resource-authorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wFAAwF,CAAC;AACnI,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM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KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -53,13 +53,19 @@ export type { GateSlotName } from "./extensions/gate-slots.js";
|
|
|
53
53
|
export type { AgentExecutionResponseDecorator, AgentExecutionStatusHooks, AgentExecutionStatusObserver, AgentExecutionStatusTransition, } from "./extensions/status-hooks.js";
|
|
54
54
|
export type { ExtensionDrivers } from "./extensions/drivers.js";
|
|
55
55
|
export type { ResolvedExtensionDrivers } from "./extensions/registry.js";
|
|
56
|
-
export type { DefaultInstanceLinkedEvent, ResourceAuthorizationLifecycle, ResourceCreatedEvent, ResourceDeletedEvent, VisibilityChangedEvent, VisibilityTupleShape, ResolvedParentLink, } from "./extensions/resource-authorization.js";
|
|
56
|
+
export type { DefaultInstanceLinkedEvent, PolicyGrantedEvent, PolicyRevokedEvent, ResourceAuthorizationLifecycle, ResourceCreatedEvent, ResourceDeletedEvent, VisibilityChangedEvent, VisibilityTupleShape, ResolvedParentLink, } from "./extensions/resource-authorization.js";
|
|
57
57
|
export type { OrganizationDirectory } from "./extensions/organization-directory.js";
|
|
58
58
|
export { ALL_ORGANIZATIONS } from "./extensions/organization-directory.js";
|
|
59
59
|
export type { IdentityAccountStore } from "./domain/identityaccount/store.js";
|
|
60
60
|
export { DuplicateAccountError } from "./domain/identityaccount/store.js";
|
|
61
61
|
export type { IdentityAccountStoreContractCase, IdentityAccountStoreContractFixture, } from "./domain/identityaccount/store-contract.js";
|
|
62
62
|
export { identityAccountStoreContract } from "./domain/identityaccount/store-contract.js";
|
|
63
|
+
export type { IamPolicyStore } from "./domain/iampolicy/store.js";
|
|
64
|
+
export { DuplicatePolicyError } from "./domain/iampolicy/store.js";
|
|
65
|
+
export type { IamPolicyStoreContractCase, IamPolicyStoreContractFixture, } from "./domain/iampolicy/store-contract.js";
|
|
66
|
+
export { iamPolicyStoreContract } from "./domain/iampolicy/store-contract.js";
|
|
67
|
+
export type { PolicyGrantScope } from "./extensions/policy-grant-scope.js";
|
|
68
|
+
export type { AuthorizationQueryEngine } from "./extensions/authorization-queries.js";
|
|
63
69
|
export type { IdentityFederation } from "./extensions/identity-federation.js";
|
|
64
70
|
export type { AccountsBySubject } from "./domain/identityaccount/resolve.js";
|
|
65
71
|
export { identityIdForSubject } from "./domain/identityaccount/resolve.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,GACR,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AASlC,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAOjE,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,YAAY,EACV,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM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,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAQrE,YAAY,EACV,cAAc,EACd,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0CAA0C,CAAC;AAOlD,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,8 @@ export { createLogger } from "./boot/logger.js";
|
|
|
46
46
|
export { ALL_ORGANIZATIONS } from "./extensions/organization-directory.js";
|
|
47
47
|
export { DuplicateAccountError } from "./domain/identityaccount/store.js";
|
|
48
48
|
export { identityAccountStoreContract } from "./domain/identityaccount/store-contract.js";
|
|
49
|
+
export { DuplicatePolicyError } from "./domain/iampolicy/store.js";
|
|
50
|
+
export { iamPolicyStoreContract } from "./domain/iampolicy/store-contract.js";
|
|
49
51
|
export { identityIdForSubject } from "./domain/identityaccount/resolve.js";
|
|
50
52
|
export { createErrorBoundaryInterceptor } from "./pipeline/interceptors/error-boundary.js";
|
|
51
53
|
export { diffVisibilityShapes, visibilityShapesFor, } from "./pipeline/steps/authorization-tuples.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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AAmC,EAAE,MAAM,gDAAgD,CAAC;AAkBrG,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,qEAAqE;AACrE,uEAAuE;AACvE,0EAA0E;AAC1E,qEAAqE;AACrE,6DAA6D;AAC7D,uEAAuE;AACvE,qEAAqE;AACrE,gEAAgE;AAChE,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,iEAAiE;AACjE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAepC,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAE9E,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,kDAAkD;AAClD,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,gBAAgB,IAAI,sCAAsC,GAC3D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AA0BrE,oEAAoE;AACpE,yEAAyE;AACzE,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
2
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
2
|
+
import { ApiResourceKind, ResourceTier } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
3
3
|
import type { ApiResourceKindMeta } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
4
|
+
import type { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
5
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
4
6
|
/** Go GetKindMeta: the kind_meta extension of the enum value. */
|
|
5
7
|
export declare function getKindMeta(kind: ApiResourceKind): ApiResourceKindMeta;
|
|
6
8
|
/** Go GetIdPrefix: e.g. agent → "agt". */
|
|
@@ -13,6 +15,25 @@ export declare function getKindName(kind: ApiResourceKind): string;
|
|
|
13
15
|
* ignored) — twin of Cloud's ApiResourceKindExtractor.
|
|
14
16
|
*/
|
|
15
17
|
export declare function getKindEnum(kindValue: string): ApiResourceKind;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves an `ApiResourceRef.kind` — a kind's enum MEMBER name, exactly
|
|
20
|
+
* as the proto spells it ("organization", "identity_account") — to the
|
|
21
|
+
* enum. Anything else, including the kind_meta spelling, a different case,
|
|
22
|
+
* the empty string and the zero value's own name, is
|
|
23
|
+
* `api_resource_kind_unknown`; never a throw, because the Authorize step
|
|
24
|
+
* resolves `resource_kind_path` through this at position 1 of every chain
|
|
25
|
+
* and resolution never fails a request (authorize.ts header). See the
|
|
26
|
+
* module header for why the match is exact.
|
|
27
|
+
*/
|
|
28
|
+
export declare function kindByEnumName(value: string): ApiResourceKind;
|
|
29
|
+
/**
|
|
30
|
+
* The inverse of `kindByEnumName`: a kind spelled as an `ApiResourceRef.kind`
|
|
31
|
+
* — the descriptor's exact proto name ("organization", "identity_account").
|
|
32
|
+
* Total over the enum: the unknown kind spells itself, so a ref built from
|
|
33
|
+
* it round-trips to the unknown kind and the gate that reads it refuses
|
|
34
|
+
* the way it refuses a wire caller's garbage; never a throw.
|
|
35
|
+
*/
|
|
36
|
+
export declare function kindEnumName(kind: ApiResourceKind): string;
|
|
16
37
|
/**
|
|
17
38
|
* Go DefaultVisibilityFor: blueprint kinds flagged defaults_to_org_visibility
|
|
18
39
|
* get visibility_org (blueprints are shared org assets — a private default
|
|
@@ -20,6 +41,40 @@ export declare function getKindEnum(kindValue: string): ApiResourceKind;
|
|
|
20
41
|
* visibility_private.
|
|
21
42
|
*/
|
|
22
43
|
export declare function defaultVisibilityFor(kind: ApiResourceKind): ApiResourceVisibility;
|
|
44
|
+
/**
|
|
45
|
+
* The roles a user may be granted on a resource of `kind` according to the
|
|
46
|
+
* CONTRACT — `kind_meta.authorization.grantable_roles`, the one source of
|
|
47
|
+
* "what can be granted at all" (Java AuthorizationConfigResolver
|
|
48
|
+
* .getGrantableRoles; the cloud's iam/policy/roles.ts grantableRolesFor,
|
|
49
|
+
* which this replaces at the 20260913.01 re-point). A kind that lists none
|
|
50
|
+
* is system-managed in every edition (identity_account, api_key,
|
|
51
|
+
* iam_policy, invitation, agent_execution); an edition's PolicyGrantScope
|
|
52
|
+
* (extensions/policy-grant-scope.ts) only narrows this list.
|
|
53
|
+
*
|
|
54
|
+
* Total, never a throw: the kind is an `ApiResourceRef.kind` resolved by
|
|
55
|
+
* `kindByEnumName`, so the unknown kind — the one member without
|
|
56
|
+
* `kind_meta` — is a legitimate argument and answers the empty list
|
|
57
|
+
* (module header, the second vocabulary).
|
|
58
|
+
*/
|
|
59
|
+
export declare function grantableRolesFor(kind: ApiResourceKind): ReadonlyArray<IamRole>;
|
|
60
|
+
/**
|
|
61
|
+
* Whether an edition serves a tier: the tier names the MINIMUM edition,
|
|
62
|
+
* the editions are ordered oss < enterprise < cloud (each composes the
|
|
63
|
+
* previous one's units), so a tier admits its own edition and every one
|
|
64
|
+
* above. An edition the server does not know (`server_edition_unspecified`)
|
|
65
|
+
* serves everything — the SDK's own fallback: an older client against a
|
|
66
|
+
* newer server hides nothing. A tier the proto forgot is treated as core
|
|
67
|
+
* for the same reason the SDK does: hiding a served kind is the worse
|
|
68
|
+
* failure.
|
|
69
|
+
*/
|
|
70
|
+
export declare function tierServedByEdition(tier: ResourceTier, edition: ServerEdition): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether this edition serves a kind: its `kind_meta.tier` through the
|
|
73
|
+
* table above. Throws for a kind without `kind_meta` (the unknown kind):
|
|
74
|
+
* a caller that reaches this with wire input has skipped the kind
|
|
75
|
+
* refusals, and "served" for it would hide that bug.
|
|
76
|
+
*/
|
|
77
|
+
export declare function kindServedByEdition(kind: ApiResourceKind, edition: ServerEdition): boolean;
|
|
23
78
|
/**
|
|
24
79
|
* Go SupportsVisibility: PRIVATE and UNSPECIFIED are always supported (no
|
|
25
80
|
* visibility grant); every other level requires the matching supports_*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiresource-meta.d.ts","sourceRoot":"","sources":["../../src/pipeline/apiresource-meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apiresource-meta.d.ts","sourceRoot":"","sources":["../../src/pipeline/apiresource-meta.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EACL,eAAe,EAEf,YAAY,EAEb,MAAM,qFAAqF,CAAC;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qFAAqF,CAAC;AAC/H,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAEtF,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAMtE;AAED,0CAA0C;AAC1C,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEzD;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAS9D;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAI7D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAO1D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,eAAe,GACpB,qBAAqB,CAKvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,GACpB,aAAa,CAAC,OAAO,CAAC,CAMxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,aAAa,GACrB,OAAO,CAET;AAkCD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAYT;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAavE"}
|
|
@@ -8,10 +8,44 @@
|
|
|
8
8
|
* Both editions resolve the same strings from the same proto metadata; the
|
|
9
9
|
* visibility helpers mirror Cloud's VisibilityConfigResolver so the
|
|
10
10
|
* cross-edition error contract is identical by construction.
|
|
11
|
+
*
|
|
12
|
+
* The contract carries TWO kind vocabularies, and this module holds one
|
|
13
|
+
* lookup for each so they are never merged:
|
|
14
|
+
*
|
|
15
|
+
* - A resource's own `kind` field is the `kind_meta.name` ("McpServer").
|
|
16
|
+
* `getKindEnum` reads it by canonical name (case-insensitive,
|
|
17
|
+
* underscores ignored) and throws on an unknown value.
|
|
18
|
+
* - An `ApiResourceRef.kind` — the IamPolicy spec's principal and
|
|
19
|
+
* resource, the FGA object type — is the enum MEMBER name
|
|
20
|
+
* ("mcp_server"). `kindByEnumName` reads it by the descriptor's exact
|
|
21
|
+
* proto name and never throws (20260913.01, Q-OR-2). Exact, because the
|
|
22
|
+
* IamPolicy id is derived from the spec's text (Q-OR-9): a lenient
|
|
23
|
+
* match would let "Organization" and "organization" mint two rows for
|
|
24
|
+
* one grant. Reading the descriptor's name is not deriving a spelling;
|
|
25
|
+
* the #545 rule is about recovering kind_meta.name from an enum, which
|
|
26
|
+
* neither lookup does. A reader asked about a kind that arrived
|
|
27
|
+
* through this vocabulary follows its doctrine: `grantableRolesFor`
|
|
28
|
+
* answers the empty list for the unknown kind instead of throwing,
|
|
29
|
+
* because the kind it is asked about may have come off the wire.
|
|
30
|
+
* `kindEnumName` is the inverse — how server code SPELLS a kind when
|
|
31
|
+
* it builds an `ApiResourceRef` itself (the built-in role lifecycle's
|
|
32
|
+
* cleanup refs; the organization-role specs) — so no caller reaches
|
|
33
|
+
* for the enum's reverse index by hand.
|
|
34
|
+
*
|
|
35
|
+
* A kind's TIER meets the served EDITION in exactly one place on the
|
|
36
|
+
* server, `tierServedByEdition` / `kindServedByEdition` (20260913.01
|
|
37
|
+
* Q-OR-8; claim check C5) — the twin of the SDK's rank functions
|
|
38
|
+
* (sdk/typescript/src/resource-availability.ts), pinned equal on the whole
|
|
39
|
+
* matrix by __tests__/kind-served-by-edition.test.ts. The console reads
|
|
40
|
+
* the SDK's answer to decide what to SHOW; `checkMyPermission` reads the
|
|
41
|
+
* server's to decide what is HELD; a disagreement is a surface that
|
|
42
|
+
* appears and then fails. The enum NUMBERS are wire identifiers, never
|
|
43
|
+
* ranks (`enterprise` sits at 3 in both enums and ranks second).
|
|
11
44
|
*/
|
|
12
45
|
import { getOption, hasOption } from "@bufbuild/protobuf";
|
|
13
46
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
14
|
-
import { ApiResourceKindSchema, kind_meta, } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
47
|
+
import { ApiResourceKind, ApiResourceKindSchema, ResourceTier, kind_meta, } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
48
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
15
49
|
/** Go GetKindMeta: the kind_meta extension of the enum value. */
|
|
16
50
|
export function getKindMeta(kind) {
|
|
17
51
|
const valueDesc = kindValueDescriptor(kind);
|
|
@@ -43,6 +77,33 @@ export function getKindEnum(kindValue) {
|
|
|
43
77
|
}
|
|
44
78
|
return kind;
|
|
45
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolves an `ApiResourceRef.kind` — a kind's enum MEMBER name, exactly
|
|
82
|
+
* as the proto spells it ("organization", "identity_account") — to the
|
|
83
|
+
* enum. Anything else, including the kind_meta spelling, a different case,
|
|
84
|
+
* the empty string and the zero value's own name, is
|
|
85
|
+
* `api_resource_kind_unknown`; never a throw, because the Authorize step
|
|
86
|
+
* resolves `resource_kind_path` through this at position 1 of every chain
|
|
87
|
+
* and resolution never fails a request (authorize.ts header). See the
|
|
88
|
+
* module header for why the match is exact.
|
|
89
|
+
*/
|
|
90
|
+
export function kindByEnumName(value) {
|
|
91
|
+
return (kindsByEnumName().get(value) ?? ApiResourceKind.api_resource_kind_unknown);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The inverse of `kindByEnumName`: a kind spelled as an `ApiResourceRef.kind`
|
|
95
|
+
* — the descriptor's exact proto name ("organization", "identity_account").
|
|
96
|
+
* Total over the enum: the unknown kind spells itself, so a ref built from
|
|
97
|
+
* it round-trips to the unknown kind and the gate that reads it refuses
|
|
98
|
+
* the way it refuses a wire caller's garbage; never a throw.
|
|
99
|
+
*/
|
|
100
|
+
export function kindEnumName(kind) {
|
|
101
|
+
// A number that is no member (a cast from outside the enum) spells as
|
|
102
|
+
// the unknown kind, which every descriptor carries as its zero value.
|
|
103
|
+
const value = kindValueDescriptor(kind) ??
|
|
104
|
+
kindValueDescriptor(ApiResourceKind.api_resource_kind_unknown);
|
|
105
|
+
return value?.name ?? "";
|
|
106
|
+
}
|
|
46
107
|
/**
|
|
47
108
|
* Go DefaultVisibilityFor: blueprint kinds flagged defaults_to_org_visibility
|
|
48
109
|
* get visibility_org (blueprints are shared org assets — a private default
|
|
@@ -55,6 +116,83 @@ export function defaultVisibilityFor(kind) {
|
|
|
55
116
|
? ApiResourceVisibility.visibility_org
|
|
56
117
|
: ApiResourceVisibility.visibility_private;
|
|
57
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The roles a user may be granted on a resource of `kind` according to the
|
|
121
|
+
* CONTRACT — `kind_meta.authorization.grantable_roles`, the one source of
|
|
122
|
+
* "what can be granted at all" (Java AuthorizationConfigResolver
|
|
123
|
+
* .getGrantableRoles; the cloud's iam/policy/roles.ts grantableRolesFor,
|
|
124
|
+
* which this replaces at the 20260913.01 re-point). A kind that lists none
|
|
125
|
+
* is system-managed in every edition (identity_account, api_key,
|
|
126
|
+
* iam_policy, invitation, agent_execution); an edition's PolicyGrantScope
|
|
127
|
+
* (extensions/policy-grant-scope.ts) only narrows this list.
|
|
128
|
+
*
|
|
129
|
+
* Total, never a throw: the kind is an `ApiResourceRef.kind` resolved by
|
|
130
|
+
* `kindByEnumName`, so the unknown kind — the one member without
|
|
131
|
+
* `kind_meta` — is a legitimate argument and answers the empty list
|
|
132
|
+
* (module header, the second vocabulary).
|
|
133
|
+
*/
|
|
134
|
+
export function grantableRolesFor(kind) {
|
|
135
|
+
const valueDesc = kindValueDescriptor(kind);
|
|
136
|
+
if (valueDesc === undefined || !hasOption(valueDesc, kind_meta)) {
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
return getOption(valueDesc, kind_meta).authorization?.grantableRoles ?? [];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Whether an edition serves a tier: the tier names the MINIMUM edition,
|
|
143
|
+
* the editions are ordered oss < enterprise < cloud (each composes the
|
|
144
|
+
* previous one's units), so a tier admits its own edition and every one
|
|
145
|
+
* above. An edition the server does not know (`server_edition_unspecified`)
|
|
146
|
+
* serves everything — the SDK's own fallback: an older client against a
|
|
147
|
+
* newer server hides nothing. A tier the proto forgot is treated as core
|
|
148
|
+
* for the same reason the SDK does: hiding a served kind is the worse
|
|
149
|
+
* failure.
|
|
150
|
+
*/
|
|
151
|
+
export function tierServedByEdition(tier, edition) {
|
|
152
|
+
if (edition === ServerEdition.server_edition_unspecified) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return editionRank(edition) >= tierRank(tier);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether this edition serves a kind: its `kind_meta.tier` through the
|
|
159
|
+
* table above. Throws for a kind without `kind_meta` (the unknown kind):
|
|
160
|
+
* a caller that reaches this with wire input has skipped the kind
|
|
161
|
+
* refusals, and "served" for it would hide that bug.
|
|
162
|
+
*/
|
|
163
|
+
export function kindServedByEdition(kind, edition) {
|
|
164
|
+
return tierServedByEdition(getKindMeta(kind).tier, edition);
|
|
165
|
+
}
|
|
166
|
+
function editionRank(edition) {
|
|
167
|
+
switch (edition) {
|
|
168
|
+
case ServerEdition.oss:
|
|
169
|
+
return 1;
|
|
170
|
+
case ServerEdition.enterprise:
|
|
171
|
+
return 2;
|
|
172
|
+
case ServerEdition.cloud:
|
|
173
|
+
case ServerEdition.server_edition_unspecified:
|
|
174
|
+
return 3;
|
|
175
|
+
default: {
|
|
176
|
+
const exhaustive = edition;
|
|
177
|
+
throw new Error(`unknown server edition: ${String(exhaustive)}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function tierRank(tier) {
|
|
182
|
+
switch (tier) {
|
|
183
|
+
case ResourceTier.open_source:
|
|
184
|
+
case ResourceTier.resource_tier_unspecified:
|
|
185
|
+
return 1;
|
|
186
|
+
case ResourceTier.enterprise:
|
|
187
|
+
return 2;
|
|
188
|
+
case ResourceTier.cloud_only:
|
|
189
|
+
return 3;
|
|
190
|
+
default: {
|
|
191
|
+
const exhaustive = tier;
|
|
192
|
+
throw new Error(`unknown resource tier: ${String(exhaustive)}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
58
196
|
/**
|
|
59
197
|
* Go SupportsVisibility: PRIVATE and UNSPECIFIED are always supported (no
|
|
60
198
|
* visibility grant); every other level requires the matching supports_*
|
|
@@ -111,4 +249,20 @@ function kindsByCanonicalName() {
|
|
|
111
249
|
}
|
|
112
250
|
return canonicalNameCache;
|
|
113
251
|
}
|
|
252
|
+
let enumNameCache;
|
|
253
|
+
/**
|
|
254
|
+
* Every member by its descriptor name, the zero value included (it maps to
|
|
255
|
+
* itself, which is the unknown kind either way). A Map rather than the TS
|
|
256
|
+
* enum's reverse mapping, so a prototype key or a number spelled as text
|
|
257
|
+
* cannot resolve to anything.
|
|
258
|
+
*/
|
|
259
|
+
function kindsByEnumName() {
|
|
260
|
+
if (enumNameCache === undefined) {
|
|
261
|
+
enumNameCache = new Map(ApiResourceKindSchema.values.map((value) => [
|
|
262
|
+
value.name,
|
|
263
|
+
value.number,
|
|
264
|
+
]));
|
|
265
|
+
}
|
|
266
|
+
return enumNameCache;
|
|
267
|
+
}
|
|
114
268
|
//# sourceMappingURL=apiresource-meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiresource-meta.js","sourceRoot":"","sources":["../../src/pipeline/apiresource-meta.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"apiresource-meta.js","sourceRoot":"","sources":["../../src/pipeline/apiresource-meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,SAAS,GACV,MAAM,qFAAqF,CAAC;AAG7F,OAAO,EAAE,aAAa,EAAE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AAC;YACd,iBAAiB,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC;YACnD,KAAK,CAAC,MAAyB;SAChC,CAAC,CACL,CAAC;IACJ,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,IAAI,aAAuD,CAAC;AAE5D;;;;;GAKG;AACH,SAAS,eAAe;IACtB,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,aAAa,GAAG,IAAI,GAAG,CACrB,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YAC1C,KAAK,CAAC,IAAI;YACV,KAAK,CAAC,MAAyB;SAChC,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -51,6 +51,18 @@ export declare function callerIdentityOf(ctx: HandlerContext): CallerIdentity;
|
|
|
51
51
|
* operator seam remains process-global.
|
|
52
52
|
*/
|
|
53
53
|
export declare function trustedLocalIdentity(): CallerIdentity;
|
|
54
|
+
/**
|
|
55
|
+
* The identityId of the UNCONFIGURED laptop's operator — no
|
|
56
|
+
* STIGMER_OPERATOR_EMAIL, so the trust domain's one principal has no
|
|
57
|
+
* email to be named by. It is what the interceptor stamps and therefore
|
|
58
|
+
* what every audit actor on such a laptop carries as `created_by.id`; the
|
|
59
|
+
* operator account derives its subject from it (`local|system`) and the
|
|
60
|
+
* membership rules read it as "not a person" when they classify creator
|
|
61
|
+
* stamps (domain/iampolicy/membership.ts). One home (20260913.01 slice 4,
|
|
62
|
+
* Q-S4-6): a second spelling anywhere would make a stamp and its reader
|
|
63
|
+
* disagree silently.
|
|
64
|
+
*/
|
|
65
|
+
export declare const SYSTEM_OPERATOR_IDENTITY_ID = "system";
|
|
54
66
|
/**
|
|
55
67
|
* The trusted-local identity for a given operator — the one construction
|
|
56
68
|
* of that principal, shared by the per-request stamp above and by the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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H,wBAAgB,oBAAoB,IAAI,cAAc,CAErD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,WAAW,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,cAAc,CAiBjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC1C,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,qBAAqB,UAAQ,GAC5B,WAAW,CAwCb;AAyCD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,+BAA+B,CAAC;AAErE,2DAA2D;AAC3D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAEpE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gCAAgC,IAAI,WAAW,CA6B9D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC1C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAoBrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAUlE"}
|
|
@@ -144,6 +144,18 @@ export function callerIdentityOf(ctx) {
|
|
|
144
144
|
export function trustedLocalIdentity() {
|
|
145
145
|
return trustedLocalIdentityFor(operatorIdentitySnapshot());
|
|
146
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* The identityId of the UNCONFIGURED laptop's operator — no
|
|
149
|
+
* STIGMER_OPERATOR_EMAIL, so the trust domain's one principal has no
|
|
150
|
+
* email to be named by. It is what the interceptor stamps and therefore
|
|
151
|
+
* what every audit actor on such a laptop carries as `created_by.id`; the
|
|
152
|
+
* operator account derives its subject from it (`local|system`) and the
|
|
153
|
+
* membership rules read it as "not a person" when they classify creator
|
|
154
|
+
* stamps (domain/iampolicy/membership.ts). One home (20260913.01 slice 4,
|
|
155
|
+
* Q-S4-6): a second spelling anywhere would make a stamp and its reader
|
|
156
|
+
* disagree silently.
|
|
157
|
+
*/
|
|
158
|
+
export const SYSTEM_OPERATOR_IDENTITY_ID = "system";
|
|
147
159
|
/**
|
|
148
160
|
* The trusted-local identity for a given operator — the one construction
|
|
149
161
|
* of that principal, shared by the per-request stamp above and by the
|
|
@@ -153,7 +165,7 @@ export function trustedLocalIdentity() {
|
|
|
153
165
|
export function trustedLocalIdentityFor(operator) {
|
|
154
166
|
if (operator.email === "") {
|
|
155
167
|
return {
|
|
156
|
-
identityId:
|
|
168
|
+
identityId: SYSTEM_OPERATOR_IDENTITY_ID,
|
|
157
169
|
callerClass: "user",
|
|
158
170
|
issuer: "",
|
|
159
171
|
rawToken: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/pipeline/interceptors/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO3E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,0DAA0D,CAAC;AAQrF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAC/C,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AAC;QACD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,iBAAyB;IACxD,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,MAAM,MAAM,GAAG,SAAS,CAAC;IACzB,IACE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,EACvD,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DescMethod, DescMessage, Message } from "@bufbuild/protobuf";
|
|
2
|
-
import
|
|
2
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
3
|
+
import type { Authorizer, AuthzCheck, AuthzDecision } from "../../extensions/authorizer.js";
|
|
3
4
|
import type { CallerIdentity } from "../../extensions/identity.js";
|
|
4
5
|
import type { PipelineStep } from "../pipeline.js";
|
|
5
6
|
/**
|
|
@@ -25,12 +26,16 @@ export declare function newPermissiveSingleTeamAuthorizer(): Authorizer;
|
|
|
25
26
|
*/
|
|
26
27
|
export declare function newAuthorizeStep<Desc extends DescMessage>(method: DescMethod, authorizer: Authorizer): PipelineStep<Desc>;
|
|
27
28
|
/**
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
* annotation's `field_path`/`resource_id` resolution;
|
|
31
|
-
*
|
|
29
|
+
* The lanes whose authorization target is server-side state rather than a
|
|
30
|
+
* request field (see the module header). `resourceId` replaces the
|
|
31
|
+
* annotation's `field_path`/`resource_id` resolution; `resourceKind`, when
|
|
32
|
+
* given, replaces its `resource_kind`/`resource_kind_path` resolution — the
|
|
33
|
+
* lane whose annotation names no kind because the kind is inside the row
|
|
34
|
+
* it loaded. Everything else — skip arms, permission, copy — still comes
|
|
35
|
+
* from the annotation.
|
|
32
36
|
*/
|
|
33
37
|
export interface AuthorizeTargetOverride {
|
|
38
|
+
readonly resourceKind?: ApiResourceKind;
|
|
34
39
|
readonly resourceId: string;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
@@ -58,4 +63,14 @@ export declare function authorizeDirect(method: DescMethod, authorizer: Authoriz
|
|
|
58
63
|
* shared fallback — the authorizeDirect precedence exactly.
|
|
59
64
|
*/
|
|
60
65
|
export declare function authorizeResolvedResource(authorizer: Authorizer, identity: CallerIdentity, check: AuthzCheck, errorMsg: string): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* An Authorizer that THROWS is an evaluation failure by definition —
|
|
68
|
+
* normalized into the unavailable arm so a buggy implementation can never
|
|
69
|
+
* soften an outage into a denial by accident. Exported for the one lane
|
|
70
|
+
* that needs the DECISION rather than the wire mapping: `checkMyPermission`
|
|
71
|
+
* answers a boolean (allow → true, deny and not-found → false) and maps
|
|
72
|
+
* only `unavailable` to the wire, through the same INTERNAL copy
|
|
73
|
+
* (20260913.01, Q-S5-3).
|
|
74
|
+
*/
|
|
75
|
+
export declare function evaluateAuthorizer(authorizer: Authorizer, identity: CallerIdentity, check: AuthzCheck): Promise<AuthzDecision>;
|
|
61
76
|
//# sourceMappingURL=authorize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../src/pipeline/steps/authorize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../src/pipeline/steps/authorize.ts"],"names":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C,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,aAAa,CAAC,CASxB"}
|
|
@@ -31,9 +31,13 @@
|
|
|
31
31
|
* Resolution never throws: an unresolvable `field_path` yields an empty
|
|
32
32
|
* resource id and an unresolvable `resource_kind_path` yields the unknown
|
|
33
33
|
* kind — the check still reaches the Authorizer, which owns the decision.
|
|
34
|
-
* A
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* A `resource_kind_path` may point at an `ApiResourceKind` field or at a
|
|
35
|
+
* string carrying a kind's enum member name (an `ApiResourceRef.kind`, the
|
|
36
|
+
* IamPolicy RPCs' spec-named target; 20260913.01 Q-OR-2); a string that is
|
|
37
|
+
* not exactly a member name is the unknown kind, which an enforcing
|
|
38
|
+
* authorizer denies. A thrown resolution would be a NEW wire behavior on
|
|
39
|
+
* requests that are legal today (byte-identity forbids it); an
|
|
40
|
+
* implementation that wants to refuse empty ids does so as a deny, visibly.
|
|
37
41
|
*
|
|
38
42
|
* `authorizeDirect` is the SAME evaluation exported for the direct
|
|
39
43
|
* handlers — the config-annotated methods that deliberately run no
|
|
@@ -42,17 +46,22 @@
|
|
|
42
46
|
* two entry shapes; a direct handler calls it after its own input
|
|
43
47
|
* validation and before any load or side effect, mirroring the Java
|
|
44
48
|
* edition's validate → authorize handler order (C2 Stage 4 ruling,
|
|
45
|
-
* 20260827.10). The optional target override serves the
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* McpServerCompleteOAuthConnectHandler
|
|
49
|
+
* 20260827.10). The optional target override serves the lanes whose true
|
|
50
|
+
* target is server-side state rather than caller input, in two shapes:
|
|
51
|
+
* a server-side ID under the annotation's static kind (completeOAuthConnect
|
|
52
|
+
* authorizes the PENDING RECORD's server id — a caller-supplied id would
|
|
53
|
+
* be a confused-deputy hole, the Java McpServerCompleteOAuthConnectHandler
|
|
54
|
+
* discipline; getByEmail/getByIdpId authorize the account they looked up),
|
|
55
|
+
* and a server-side kind AND id (the IamPolicy `get`, whose annotation
|
|
56
|
+
* names no kind because the target is the loaded row's resource). The
|
|
57
|
+
* annotation keeps owning the permission, the copy and the skip arms in
|
|
58
|
+
* both shapes; only the target is the handler's.
|
|
50
59
|
*/
|
|
51
60
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
52
61
|
import { getOption, hasOption } from "@bufbuild/protobuf";
|
|
53
62
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
54
63
|
import { config as rpcAuthorizationConfig, is_public, is_skip_authorization, } from "@stigmer/protos/ai/stigmer/commons/rpc/method_options_pb";
|
|
55
|
-
import { getKindName } from "../apiresource-meta.js";
|
|
64
|
+
import { getKindName, kindByEnumName } from "../apiresource-meta.js";
|
|
56
65
|
import { internalError, notFoundError } from "../errors.js";
|
|
57
66
|
/**
|
|
58
67
|
* The wire copy for the unavailable arm — static and sanitized (#478):
|
|
@@ -109,7 +118,7 @@ export async function authorizeDirect(method, authorizer, identity, input, overr
|
|
|
109
118
|
const config = getOption(method, rpcAuthorizationConfig);
|
|
110
119
|
return authorizeResolvedResource(authorizer, identity, {
|
|
111
120
|
permission: config.permission,
|
|
112
|
-
resourceKind: resolveResourceKind(input, config),
|
|
121
|
+
resourceKind: override?.resourceKind ?? resolveResourceKind(input, config),
|
|
113
122
|
resourceId: override?.resourceId ?? resolveResourceId(input, config),
|
|
114
123
|
}, config.errorMsg);
|
|
115
124
|
}
|
|
@@ -134,7 +143,7 @@ export async function authorizeResolvedResource(authorizer, identity, check, err
|
|
|
134
143
|
if (identity.callerClass === "internal") {
|
|
135
144
|
return;
|
|
136
145
|
}
|
|
137
|
-
const decision = await
|
|
146
|
+
const decision = await evaluateAuthorizer(authorizer, identity, check);
|
|
138
147
|
switch (decision.kind) {
|
|
139
148
|
case "allow":
|
|
140
149
|
return;
|
|
@@ -165,9 +174,13 @@ export async function authorizeResolvedResource(authorizer, identity, check, err
|
|
|
165
174
|
/**
|
|
166
175
|
* An Authorizer that THROWS is an evaluation failure by definition —
|
|
167
176
|
* normalized into the unavailable arm so a buggy implementation can never
|
|
168
|
-
* soften an outage into a denial by accident.
|
|
177
|
+
* soften an outage into a denial by accident. Exported for the one lane
|
|
178
|
+
* that needs the DECISION rather than the wire mapping: `checkMyPermission`
|
|
179
|
+
* answers a boolean (allow → true, deny and not-found → false) and maps
|
|
180
|
+
* only `unavailable` to the wire, through the same INTERNAL copy
|
|
181
|
+
* (20260913.01, Q-S5-3).
|
|
169
182
|
*/
|
|
170
|
-
async function
|
|
183
|
+
export async function evaluateAuthorizer(authorizer, identity, check) {
|
|
171
184
|
try {
|
|
172
185
|
return await authorizer.authorize(identity, check);
|
|
173
186
|
}
|
|
@@ -178,15 +191,22 @@ async function runAuthorizer(authorizer, identity, check) {
|
|
|
178
191
|
};
|
|
179
192
|
}
|
|
180
193
|
}
|
|
181
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Static kind, or the resource_kind_path read — an enum field as its
|
|
196
|
+
* number, a string as an enum member name — or unknown. Never a throw.
|
|
197
|
+
*/
|
|
182
198
|
function resolveResourceKind(input, config) {
|
|
183
199
|
if (config.resourceKindPath === "") {
|
|
184
200
|
return config.resourceKind;
|
|
185
201
|
}
|
|
186
202
|
const value = resolveDotPath(input, config.resourceKindPath);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
203
|
+
if (typeof value === "number") {
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
if (typeof value === "string") {
|
|
207
|
+
return kindByEnumName(value);
|
|
208
|
+
}
|
|
209
|
+
return ApiResourceKind.api_resource_kind_unknown;
|
|
190
210
|
}
|
|
191
211
|
/** Static resource_id, or the field_path read, or "" — never a throw. */
|
|
192
212
|
function resolveResourceId(input, config) {
|