feat(provider): add Gelios SDK package v2
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# Gelios provider package v2
|
||||
|
||||
Version 2 keeps the provider-neutral `fleet.positions.current.v1` mapping and
|
||||
switches the Robot2B connection transport to the durable Gelios SDK token that
|
||||
is already used by the legacy Engine/Cesium contour.
|
||||
|
||||
- endpoint: `GET https://admin.geliospro.com/sdk/`;
|
||||
- static query: `svc=get_units`, `params={}`;
|
||||
- secret query parameter: `token`, injected only by native NDC L2
|
||||
`httpQueryAuth` credentials;
|
||||
- token lifecycle: one durable access artifact, no refresh operation;
|
||||
- graph/package/logs never contain the token value.
|
||||
|
||||
The v1 REST bearer package remains immutable historical evidence. A v2
|
||||
connection must use a separately registered native Query Auth credential whose
|
||||
name is `token`; it must not reinterpret an SDK token as an HTTP Bearer token.
|
||||
@@ -0,0 +1,11 @@
|
||||
export {
|
||||
GELIOS_POSITIONS_DATA_PRODUCT_ID,
|
||||
GELIOS_POSITIONS_DATA_PRODUCT_VERSION,
|
||||
GELIOS_POSITIONS_ONTOLOGY_REVISION,
|
||||
GELIOS_PROVIDER_PACKAGE_ID,
|
||||
GELIOS_PROVIDER_PACKAGE_VERSION,
|
||||
GELIOS_UNIT_SOURCE_ID_PREFIX,
|
||||
geliosProviderPackageV2,
|
||||
} from "./package.mjs";
|
||||
|
||||
export { geliosUnitsCurrentFixtureV1 as geliosUnitsCurrentFixtureV2 } from "../v1/fixtures/units-current.fixture.mjs";
|
||||
@@ -0,0 +1,102 @@
|
||||
import { geliosProviderPackageV1 } from "../v1/package.mjs";
|
||||
|
||||
export const GELIOS_PROVIDER_PACKAGE_ID = "gelios.provider.v2";
|
||||
export const GELIOS_PROVIDER_PACKAGE_VERSION = "2.0.0";
|
||||
export const GELIOS_POSITIONS_DATA_PRODUCT_ID = "fleet.positions.current.v1";
|
||||
export const GELIOS_POSITIONS_DATA_PRODUCT_VERSION = "1.0.0";
|
||||
export const GELIOS_POSITIONS_ONTOLOGY_REVISION = "ontology.map.moving_object.v1";
|
||||
export const GELIOS_UNIT_SOURCE_ID_PREFIX = "gelios-unit-";
|
||||
|
||||
const AUTH_MODE_ID = "gelios.sdk-query-token.v2";
|
||||
const CAPABILITY_ID = "gelios.units.current.sdk.read";
|
||||
const REALTIME_PROFILE_ID = "gelios.positions.current.realtime.v2";
|
||||
const MANUAL_PROFILE_ID = "gelios.positions.current.manual.v2";
|
||||
const MAPPING_ID = "gelios.units.to.fleet.positions.current.v2";
|
||||
const TEMPLATE_ID = "gelios.positions.current.l2.v2";
|
||||
|
||||
const value = structuredClone(geliosProviderPackageV1);
|
||||
value.id = GELIOS_PROVIDER_PACKAGE_ID;
|
||||
value.version = GELIOS_PROVIDER_PACKAGE_VERSION;
|
||||
value.manifest = {
|
||||
...value.manifest,
|
||||
id: "gelios.provider.manifest.v2",
|
||||
version: GELIOS_PROVIDER_PACKAGE_VERSION,
|
||||
authModeIds: [AUTH_MODE_ID],
|
||||
capabilityIds: [CAPABILITY_ID],
|
||||
collectionProfileIds: [REALTIME_PROFILE_ID, MANUAL_PROFILE_ID],
|
||||
mappingContractIds: [MAPPING_ID],
|
||||
l2TemplateIds: [TEMPLATE_ID],
|
||||
};
|
||||
value.authModes = [{
|
||||
id: AUTH_MODE_ID,
|
||||
kind: "api_token",
|
||||
credentialOwner: "ndc_l2_credentials",
|
||||
bindingCardinality: "one_per_connection",
|
||||
transport: {
|
||||
placement: "query",
|
||||
name: "token",
|
||||
},
|
||||
tokenLifecycle: {
|
||||
artifacts: ["access"],
|
||||
requestArtifact: "access",
|
||||
refreshMode: "not_applicable",
|
||||
},
|
||||
secretHandling: {
|
||||
store: "ndc_l2_credentials",
|
||||
exposeToGraph: false,
|
||||
persistInPackage: false,
|
||||
},
|
||||
}];
|
||||
value.capabilities = [{
|
||||
...value.capabilities[0],
|
||||
id: CAPABILITY_ID,
|
||||
authModeId: AUTH_MODE_ID,
|
||||
request: {
|
||||
method: "GET",
|
||||
baseUrl: "https://admin.geliospro.com",
|
||||
path: "/sdk/",
|
||||
query: {
|
||||
svc: "get_units",
|
||||
params: "{}",
|
||||
},
|
||||
response: value.capabilities[0].request.response,
|
||||
},
|
||||
}];
|
||||
value.collectionProfiles = value.collectionProfiles.map((profile, index) => ({
|
||||
...profile,
|
||||
id: index === 0 ? REALTIME_PROFILE_ID : MANUAL_PROFILE_ID,
|
||||
version: GELIOS_PROVIDER_PACKAGE_VERSION,
|
||||
capabilityIds: [CAPABILITY_ID],
|
||||
mappingContractId: MAPPING_ID,
|
||||
l2TemplateId: TEMPLATE_ID,
|
||||
}));
|
||||
value.mappingContracts = [{
|
||||
...value.mappingContracts[0],
|
||||
id: MAPPING_ID,
|
||||
version: GELIOS_PROVIDER_PACKAGE_VERSION,
|
||||
sourceCapabilityId: CAPABILITY_ID,
|
||||
}];
|
||||
value.l2Templates = [{
|
||||
...value.l2Templates[0],
|
||||
id: TEMPLATE_ID,
|
||||
version: GELIOS_PROVIDER_PACKAGE_VERSION,
|
||||
credentialBindings: value.l2Templates[0].credentialBindings.map((binding) => (
|
||||
binding.role === "provider" ? { ...binding, authModeId: AUTH_MODE_ID } : binding
|
||||
)),
|
||||
steps: value.l2Templates[0].steps.map((step) => {
|
||||
if (step.kind === "provider_request" || step.kind === "extract_items") {
|
||||
return { ...step, capabilityId: CAPABILITY_ID };
|
||||
}
|
||||
if (step.kind === "semantic_mapping") return { ...step, mappingContractId: MAPPING_ID };
|
||||
return step;
|
||||
}),
|
||||
}];
|
||||
|
||||
export const geliosProviderPackageV2 = deepFreeze(value);
|
||||
|
||||
function deepFreeze(input) {
|
||||
if (!input || typeof input !== "object" || Object.isFrozen(input)) return input;
|
||||
Object.freeze(input);
|
||||
for (const child of Object.values(input)) deepFreeze(child);
|
||||
return input;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
geliosProviderPackageV1,
|
||||
geliosUnitsCurrentFixtureV1,
|
||||
} from "../providers/gelios/v1/index.mjs";
|
||||
import { geliosProviderPackageV2 } from "../providers/gelios/v2/index.mjs";
|
||||
import { normalizeDataProductDefinition } from "../../../services/external-data-plane/src/data-product-policy.mjs";
|
||||
|
||||
const expectedFields = [
|
||||
@@ -33,6 +34,23 @@ const expectedFields = [
|
||||
];
|
||||
|
||||
assert.deepEqual(validateProviderPackage(geliosProviderPackageV1), { ok: true, errors: [] });
|
||||
assert.deepEqual(validateProviderPackage(geliosProviderPackageV2), { ok: true, errors: [] });
|
||||
|
||||
const geliosSdkAuth = geliosProviderPackageV2.authModes[0];
|
||||
const geliosSdkUnitsRead = geliosProviderPackageV2.capabilities[0];
|
||||
assert.equal(geliosProviderPackageV2.id, "gelios.provider.v2");
|
||||
assert.equal(geliosProviderPackageV2.version, "2.0.0");
|
||||
assert.equal(geliosSdkAuth.id, "gelios.sdk-query-token.v2");
|
||||
assert.deepEqual(geliosSdkAuth.transport, { placement: "query", name: "token" });
|
||||
assert.deepEqual(geliosSdkAuth.tokenLifecycle, {
|
||||
artifacts: ["access"],
|
||||
requestArtifact: "access",
|
||||
refreshMode: "not_applicable",
|
||||
});
|
||||
assert.equal(geliosSdkUnitsRead.request.baseUrl, "https://admin.geliospro.com");
|
||||
assert.equal(geliosSdkUnitsRead.request.path, "/sdk/");
|
||||
assert.deepEqual(geliosSdkUnitsRead.request.query, { svc: "get_units", params: "{}" });
|
||||
assert.equal(geliosProviderPackageV2.dataProducts[0].id, GELIOS_POSITIONS_DATA_PRODUCT_ID);
|
||||
|
||||
const geliosAuth = geliosProviderPackageV1.authModes[0];
|
||||
const geliosUnitsRead = geliosProviderPackageV1.capabilities[0];
|
||||
|
||||
Reference in New Issue
Block a user