feat(deploy): promote publish-path provider authority
This commit is contained in:
@@ -420,10 +420,10 @@ ENGINE_PROVIDER_AUTHORITY_DIAGNOSTICS_ARTIFACT_ENTRIES = (
|
||||
"nodedc-source/server/dataProductPublishGrant/providerCatalog.js",
|
||||
)
|
||||
ENGINE_PROVIDER_AUTHORITY_DIAGNOSTICS_PREDECESSOR_SHA256 = {
|
||||
"nodedc-source/server/dataProductPublishGrant/providerCatalog.js": "f6cf5f4de9e57f87fb904e2136a9f34d494e1ffc289aec3ed9ed788b5583a062",
|
||||
"nodedc-source/server/dataProductPublishGrant/providerCatalog.js": "e4c216b0affd89ddbd48abcec86febd48eb12a4c56507851daeb47f2ccd60c9a",
|
||||
}
|
||||
ENGINE_PROVIDER_AUTHORITY_DIAGNOSTICS_TARGET_SHA256 = {
|
||||
"nodedc-source/server/dataProductPublishGrant/providerCatalog.js": "1a14299167ebe17efd677fa3c59b84c80e12d6846bac6f40f9bcae0729ab22c6",
|
||||
"nodedc-source/server/dataProductPublishGrant/providerCatalog.js": "86e23683054860bb21b47e4e60a13db741088ee214a60704fd4fd24a49ea5852",
|
||||
}
|
||||
ENGINE_DEPTTRANS_ZONE_AUTHORITY_V1_ARTIFACT_ENTRIES = (
|
||||
"nodedc-source/server/assets/provider-packages/v1/catalog.json",
|
||||
@@ -4145,22 +4145,24 @@ const catalog=await module.loadProviderSecurityCatalog();
|
||||
const slot='ndcProviderRotatingAccessApi';
|
||||
const credential={id:'native-provider',name:'provider',nodeDcCredentialId:'provider-ref'};
|
||||
const policy={kind:'httpRequest',allowedHosts:['api.geliospro.com'],requireHttps:true,disableRedirects:true};
|
||||
const read=(id,url,parameters={})=>({id,data:{n8n:{id,name:id,type:'n8n-nodes-base.httpRequest',parameters:{method:'GET',url,...parameters},credentials:{[slot]:credential}},nodedcAgentCredentialPolicies:{[slot]:structuredClone(policy)}}});
|
||||
const query={sendQuery:true,specifyQuery:'keypair',queryParameters:{parameters:[{name:'incltrip',value:'true'}]}};
|
||||
const graph={nodes:[read('monitoring','https://api.geliospro.com/api/v1/users/me/monitoring-config'),read('units','https://api.geliospro.com/api/v1/units',query),{id:'publish',data:{n8n:{id:'publish',name:'publish',type:'n8n-nodes-ndc.ndcDataProductPublish',parameters:{dataProductId:'fleet.positions.current.v3'},credentials:{}}}}],edges:[{source:'monitoring',target:'publish'},{source:'units',target:'publish'}]};
|
||||
const valid=module.resolveProviderConnectionFromGraph({graph,targetNodeId:'publish',catalog});
|
||||
const policyDrift=structuredClone(graph);policyDrift.nodes[0].data.nodedcAgentCredentialPolicies[slot].allowedHosts=['*.geliospro.com'];
|
||||
const policyResult=module.resolveProviderConnectionFromGraph({graph:policyDrift,targetNodeId:'publish',catalog});
|
||||
const bindingDrift=structuredClone(graph);delete bindingDrift.nodes[0].data.n8n.credentials[slot].id;
|
||||
const bindingResult=module.resolveProviderConnectionFromGraph({graph:bindingDrift,targetNodeId:'publish',catalog});
|
||||
if(!valid.ok||policyResult.blockers?.join(',')!=='publish_grant_provider_transport_policy_not_exact'||bindingResult.blockers?.join(',')!=='publish_grant_provider_credential_binding_invalid')process.exit(2);
|
||||
process.stdout.write('engine-provider-authority-diagnostics:exact-reason-codes:v1');
|
||||
const query={sendQuery:true,specifyQuery:'keypair',queryParameters:{parameters:[{name:'incltrip',value:'true'},{name:'inclcntrs',value:'true'},{name:'inclsnsrs',value:'true'},{name:'incllsv',value:'true'}]}};
|
||||
const read=(id)=>({id,data:{n8n:{id,name:id,type:'n8n-nodes-base.httpRequest',parameters:{method:'GET',url:'https://api.geliospro.com/api/v1/units',...structuredClone(query)},credentials:{[slot]:credential}},nodedcAgentCredentialPolicies:{[slot]:structuredClone(policy)}}});
|
||||
const publish=(id,dataProductId)=>({id,data:{n8n:{id,name:id,type:'n8n-nodes-ndc.ndcDataProductPublish',parameters:{dataProductId},credentials:{}}}});
|
||||
const graph={nodes:[read('hot-read'),read('profile-read'),publish('hot-publish','fleet.positions.current.v5'),publish('profile-publish','fleet.units.profile.current.v1')],edges:[{source:'hot-read',target:'hot-publish'},{source:'profile-read',target:'profile-publish'}]};
|
||||
const hot=module.resolveProviderConnectionFromGraph({graph,targetNodeId:'hot-publish',catalog});
|
||||
const profile=module.resolveProviderConnectionFromGraph({graph,targetNodeId:'profile-publish',catalog});
|
||||
const crossed=structuredClone(graph);crossed.edges.push({source:'hot-read',target:'profile-publish'});
|
||||
const ambiguous=module.resolveProviderConnectionFromGraph({graph:crossed,targetNodeId:'profile-publish',catalog});
|
||||
const drift=structuredClone(graph);drift.nodes[1].data.n8n.parameters.queryParameters.parameters.pop();
|
||||
const rejected=module.resolveProviderConnectionFromGraph({graph:drift,targetNodeId:'profile-publish',catalog});
|
||||
if(!hot.ok||hot.descriptor?.packageId!=='gelios.provider.v7'||hot.descriptor?.providerRequestNodeId!=='hot-read'||!profile.ok||profile.descriptor?.packageId!=='gelios.provider.v8'||profile.descriptor?.providerRequestNodeId!=='profile-read'||ambiguous.blockers?.join(',')!=='publish_grant_provider_request_not_exact'||rejected.blockers?.join(',')!=='publish_grant_provider_request_not_exact')process.exit(2);
|
||||
process.stdout.write('engine-provider-authority:publish-path-scoped:v2');
|
||||
""".strip(),
|
||||
),
|
||||
"Engine provider authority diagnostics",
|
||||
"Engine provider publish-path authority",
|
||||
container_id=engine_backend_container_id(),
|
||||
)
|
||||
expected = "engine-provider-authority-diagnostics:exact-reason-codes:v1"
|
||||
expected = "engine-provider-authority:publish-path-scoped:v2"
|
||||
if live != expected:
|
||||
die("Engine provider authority diagnostics live acceptance mismatch")
|
||||
return {
|
||||
@@ -4645,6 +4647,8 @@ def validate_engine_provider_authority_diagnostics_slice(payload_dir, entries):
|
||||
"publish_grant_provider_transport_policy_not_exact",
|
||||
"publish_grant_provider_request_path_unreachable",
|
||||
"publish_grant_provider_credential_identity_mismatch",
|
||||
"exactRequestMatches",
|
||||
"reachableRequestNodes",
|
||||
)
|
||||
if any(marker not in source for marker in required_markers):
|
||||
die("Engine provider authority diagnostics reason-code contract mismatch")
|
||||
@@ -5492,7 +5496,7 @@ def preflight_engine_provider_authority_diagnostics_predecessor():
|
||||
if backend["mode"] != "verified-derived-retry":
|
||||
die("Engine provider authority diagnostics requires the active immutable backend")
|
||||
return {
|
||||
"mode": "exact-provider-authority-reason-codes",
|
||||
"mode": "publish-path-scoped-provider-request-authority",
|
||||
"predecessor_sha256": actual,
|
||||
"target_sha256": dict(ENGINE_PROVIDER_AUTHORITY_DIAGNOSTICS_TARGET_SHA256),
|
||||
"backend_mode": backend["mode"],
|
||||
@@ -8089,9 +8093,9 @@ def plan_artifact(artifact):
|
||||
print("engine_ui=untouched")
|
||||
print("engine_databases=untouched")
|
||||
if provider_authority_diagnostics_preflight:
|
||||
print("engine_provider_authority_transition=exact-safe-reason-codes")
|
||||
print("engine_provider_package=gelios.provider.v4")
|
||||
print("engine_data_product=fleet.positions.current.v3")
|
||||
print("engine_provider_authority_transition=publish-path-scoped-provider-request-authority")
|
||||
print("engine_provider_packages=gelios.provider.v7,gelios.provider.v8")
|
||||
print("engine_data_products=fleet.positions.current.v5,fleet.units.profile.current.v1")
|
||||
print("provider_credential_values=preserved")
|
||||
for changed_path in ENGINE_PROVIDER_AUTHORITY_DIAGNOSTICS_ARTIFACT_ENTRIES:
|
||||
print(f"engine_provider_authority_changed_path={changed_path}")
|
||||
|
||||
Reference in New Issue
Block a user