openxiangda-contracts 2.73.0 → 2.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native-compiler/compiler.d.ts.map +1 -1
- package/dist/native-compiler/compiler.js +26 -2
- package/dist/native-compiler/compiler.js.map +1 -1
- package/dist/native-compiler/index.cjs +5 -5
- package/dist/native-compiler/index.d.ts +1 -0
- package/dist/native-compiler/index.d.ts.map +1 -1
- package/dist/native-compiler/index.js +5 -5
- package/dist/native-compiler/parent-read-policy.d.ts +23 -0
- package/dist/native-compiler/parent-read-policy.d.ts.map +1 -0
- package/dist/native-compiler/parent-read-policy.js +83 -0
- package/dist/native-compiler/parent-read-policy.js.map +1 -0
- package/dist/native-version.d.ts +1 -0
- package/dist/native-version.d.ts.map +1 -1
- package/dist/native-version.js +1 -0
- package/dist/native-version.js.map +1 -1
- package/dist/native.d.ts +6 -0
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/native-compiler/compiler.ts"],"names":[],"mappings":"AAqCA,OAAO,EAEL,KAAK,kCAAkC,IAAI,uCAAuC,EACnF,MAAM,aAAa,CAAC;AA2BrB,QAAA,MAAM,iBAAiB,mDAAmD,CAAC;AAC3E,QAAA,MAAM,yBAAyB,YAA2C,CAAC;AA+E3E,OAAO,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAEhJ,OAAO,EAAE,2BAA2B,EAAE,wCAAwC,EAAE,mCAAmC,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAE1N,eAAO,MAAM,mBAAmB,6HAItB,CAAC;AACX,eAAO,MA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Z,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAY5C;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,gCAAgC,GACtC,iCAAiC,CA2JnC;AAaD,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,UAAU,GACjB,uCAAuC,EAAE,CA0f3C;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE;IACtD,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC;CAChC,GAAG,wBAAwB,EAAE,CAgK7B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasNativeParentReadPolicy, resolveNativeParentReadBinding, validateNativeParentReadPolicies, NativeParentReadPolicyError } from './parent-read-policy.js';
|
|
1
2
|
import { requiresExtendedFieldCapacity, WORKFLOW_LAUNCH_MAX_INPUTS } from './data-capacity.js';
|
|
2
3
|
import { assertWorkflowNativeStagePolicy } from './workflow-native-stage.js';
|
|
3
4
|
import { validateAuthenticatedPublicRead, AuthenticatedPublicReadContractError } from './authenticated-public-read.js';
|
|
@@ -416,6 +417,9 @@ export function compileRequiredPlatformCapabilitiesV3(config) {
|
|
|
416
417
|
...(operations.some(operation => operation.platformAccess?.dataCommands)
|
|
417
418
|
? [{ code: 'data.business-commands', declaration: operations.filter(operation => operation.platformAccess?.dataCommands) }]
|
|
418
419
|
: []),
|
|
420
|
+
...(config.authz.dataPolicies.some(hasNativeParentReadPolicy)
|
|
421
|
+
? [{ code: 'data.parent-read-policy',
|
|
422
|
+
declaration: config.authz.dataPolicies.filter(hasNativeParentReadPolicy) }] : []),
|
|
419
423
|
...(config.authz.dataPolicies.some((policy) => policy.publicRead)
|
|
420
424
|
? [{ code: 'data.authenticated-public-projection',
|
|
421
425
|
declaration: config.authz.dataPolicies.filter((policy) => policy.publicRead) }]
|
|
@@ -797,11 +801,15 @@ export function compileNativeEventCapturePlansV2(input) {
|
|
|
797
801
|
}
|
|
798
802
|
const authorizationFields = new Set();
|
|
799
803
|
for (const rule of policy?.rules || []) {
|
|
800
|
-
authorizationFields.add(
|
|
804
|
+
authorizationFields.add(rule.parentRead
|
|
805
|
+
? resolveNativeParentReadBinding(input.resources, code, rule.parentRead, `${pointer}/parentRead`).foreignKey
|
|
806
|
+
: String(rule.field));
|
|
801
807
|
}
|
|
802
808
|
if (policy?.readExpression) {
|
|
803
809
|
for (const entry of nativeDataPolicyExpressionLeavesV2(policy.readExpression, `${pointer}/readExpression`)) {
|
|
804
|
-
authorizationFields.add(
|
|
810
|
+
authorizationFields.add(entry.rule.parentRead
|
|
811
|
+
? resolveNativeParentReadBinding(input.resources, code, entry.rule.parentRead, `${pointer}/parentRead`).foreignKey
|
|
812
|
+
: String(entry.rule.field));
|
|
805
813
|
}
|
|
806
814
|
}
|
|
807
815
|
const filterFields = new Set();
|
|
@@ -4308,6 +4316,7 @@ function validateDataPolicyReferences(config) {
|
|
|
4308
4316
|
}
|
|
4309
4317
|
for (const { rule, pointer: rulePointer } of ruleEntries) {
|
|
4310
4318
|
exactKeys(rule, [
|
|
4319
|
+
'parentRead',
|
|
4311
4320
|
'subject',
|
|
4312
4321
|
'dimensionCode',
|
|
4313
4322
|
'relationCode',
|
|
@@ -4321,6 +4330,13 @@ function validateDataPolicyReferences(config) {
|
|
|
4321
4330
|
'value',
|
|
4322
4331
|
'operand',
|
|
4323
4332
|
], rulePointer, true);
|
|
4333
|
+
if (rule.parentRead !== undefined) {
|
|
4334
|
+
for (const roleCode of uniqueStrings(rule.roleCodes || [], `${rulePointer}/roleCodes`, 100)) {
|
|
4335
|
+
if (!roleCodes.has(roleCode))
|
|
4336
|
+
fail('NATIVE_ROLE_REFERENCE_MISSING', `${rulePointer}/roleCodes`);
|
|
4337
|
+
}
|
|
4338
|
+
continue;
|
|
4339
|
+
}
|
|
4324
4340
|
const field = fieldCodeValue(rule.field, `${rulePointer}/field`);
|
|
4325
4341
|
const fieldDefinition = policyFields?.get(field);
|
|
4326
4342
|
if (hasReadExpression && !fieldDefinition) {
|
|
@@ -4405,6 +4421,14 @@ function validateDataPolicyReferences(config) {
|
|
|
4405
4421
|
}
|
|
4406
4422
|
}
|
|
4407
4423
|
}
|
|
4424
|
+
try {
|
|
4425
|
+
validateNativeParentReadPolicies(config.data.resources, config.authz.dataPolicies);
|
|
4426
|
+
}
|
|
4427
|
+
catch (error) {
|
|
4428
|
+
if (error instanceof NativeParentReadPolicyError)
|
|
4429
|
+
fail(error.code, error.pointer);
|
|
4430
|
+
throw error;
|
|
4431
|
+
}
|
|
4408
4432
|
for (const [index, raw] of config.data.resources.entries()) {
|
|
4409
4433
|
const resource = object(raw, `/config/data/resources/${index}`);
|
|
4410
4434
|
if (resource.dataPolicyCode && !policyCodes.has(resource.dataPolicyCode)) {
|