import { deepFreezeValue } from './private/canonicaljson.js'; import type { IAuthenticatedCloudlyLegacyDeploymentSettlementApplyResultV1, IAuthenticatedCloudlyLegacyDeploymentSettlementCheckResultV1, IAuthenticatedCloudlyLegacyDeploymentSettlementPlanV1, IAuthenticatedCloudlyLegacyDeploymentSettlementProductionRequestV1, IAuthenticatedCloudlyLegacyDeploymentSettlementRehearsalBindingV1, IAuthenticatedCloudlyLegacyDeploymentSettlementStableOutcomeV1, ICloudlyLegacyDeploymentSettlementAuthorityMetadataV1, ICloudlyLegacyDeploymentSettlementAuthorityReferenceV1, ICloudlyLegacyDeploymentSettlementPlanV1, ICloudlyLegacyDeploymentSettlementProductionRequestV1, ICloudlyLegacyDeploymentSettlementProductionReceiptV1, ICloudlyLegacyDeploymentSettlementRehearsalBindingV1, ICloudlyLegacyDeploymentSettlementScratchReceiptV1, ICloudlyLegacyDeploymentSettlementStableOutcomeV1, TCloudlyLegacyDeploymentSettlementApplyResultV1, TCloudlyLegacyDeploymentSettlementCheckResultV1, } from './runtime.cloudlylegacydeploymentsettlement.js'; interface IGoldenVector { input: T; canonicalSha256: string; authenticatedInput: TAuthenticated; authenticatedCanonicalSha256: string; hmac: string; } interface ICloudlyLegacyDeploymentSettlementGoldenVectorsV1 { version: 1; authority: { metadata: ICloudlyLegacyDeploymentSettlementAuthorityMetadataV1; reference: ICloudlyLegacyDeploymentSettlementAuthorityReferenceV1; metadataCanonicalSha256: string; aadSha256: string; }; rehearsalBinding: IGoldenVector< ICloudlyLegacyDeploymentSettlementRehearsalBindingV1, IAuthenticatedCloudlyLegacyDeploymentSettlementRehearsalBindingV1 >; plan: IGoldenVector< ICloudlyLegacyDeploymentSettlementPlanV1, IAuthenticatedCloudlyLegacyDeploymentSettlementPlanV1 >; productionRequest: IGoldenVector< ICloudlyLegacyDeploymentSettlementProductionRequestV1, IAuthenticatedCloudlyLegacyDeploymentSettlementProductionRequestV1 >; checkResult: IGoldenVector< TCloudlyLegacyDeploymentSettlementCheckResultV1, IAuthenticatedCloudlyLegacyDeploymentSettlementCheckResultV1 >; applyResult: IGoldenVector< TCloudlyLegacyDeploymentSettlementApplyResultV1, IAuthenticatedCloudlyLegacyDeploymentSettlementApplyResultV1 >; stableOutcome: IGoldenVector< ICloudlyLegacyDeploymentSettlementStableOutcomeV1, IAuthenticatedCloudlyLegacyDeploymentSettlementStableOutcomeV1 >; scratchReceipt: { input: ICloudlyLegacyDeploymentSettlementScratchReceiptV1; canonicalSha256: string; hmac: string; }; productionReceipt: { input: ICloudlyLegacyDeploymentSettlementProductionReceiptV1; canonicalSha256: string; hmac: string; }; } const sha1 = '1111111111111111111111111111111111111111111111111111111111111111'; const sha2 = '2222222222222222222222222222222222222222222222222222222222222222'; const sha3 = '3333333333333333333333333333333333333333333333333333333333333333'; const sha4 = '4444444444444444444444444444444444444444444444444444444444444444'; const sha5 = '5555555555555555555555555555555555555555555555555555555555555555'; const sha6 = '6666666666666666666666666666666666666666666666666666666666666666'; const sha7 = '7777777777777777777777777777777777777777777777777777777777777777'; const sha8 = '8888888888888888888888888888888888888888888888888888888888888888'; const sha9 = '9999999999999999999999999999999999999999999999999999999999999999'; const shaa = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; const shab = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; const stateC = 'hmac-sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' as const; const stateD = 'hmac-sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd' as const; const authorityMetadata: ICloudlyLegacyDeploymentSettlementAuthorityMetadataV1 = { schemaVersion: 1, operationId: 'settle-operation-1', authorityId: 'authority-1', keyId: 'settlement-key-1', keyVersion: 1, settlementId: 'settlement-1', issuedAt: 1_700_000_000_000, expiresAt: 1_700_003_600_000, maintenanceImageDigest: `sha256:${sha1}`, sourceImageDigest: `sha256:${sha2}`, targetImageDigest: `sha256:${sha3}`, targetVersion: '18.2.0', targetManifestSha256: sha4, targetConfigSha256: sha5, backupId: 'backup-1', backupSnapshotIdSha256: sha6, backupProofSha256: sha7, runId: 'run-1', rehearsalId: 'rehearsal-1', scratchServiceId: 'service-cloudly-scratch', allocationId: 'allocation-1', allocationGeneration: 2, allocationBindingSha256: sha8, allocationReceiptSha256: sha9, sourceDataSha256: shaa, restoredDataSha256: shaa, digestProofSha256: shab, }; const authorityReference: ICloudlyLegacyDeploymentSettlementAuthorityReferenceV1 = { operationId: authorityMetadata.operationId, authorityId: authorityMetadata.authorityId, keyId: authorityMetadata.keyId, keyVersion: authorityMetadata.keyVersion, authorityMetadataSha256: 'da410b15675f0387a5266aecba70984c944cd45a9183e275438b299b42e42659', }; const rehearsalBinding: ICloudlyLegacyDeploymentSettlementRehearsalBindingV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-rehearsal-binding', settlementId: 'settlement-1', runId: 'run-1', rehearsalId: 'rehearsal-1', scratchServiceId: 'service-cloudly-scratch', allocationId: 'allocation-1', allocationGeneration: 2, allocationBindingSha256: sha8, allocationReceiptSha256: sha9, backupId: 'backup-1', backupSnapshotIdSha256: sha6, backupProofSha256: sha7, sourceDataSha256: shaa, restoredDataSha256: shaa, digestProofSha256: shab, targetImageDigest: `sha256:${sha3}`, targetVersion: '18.2.0', targetManifestSha256: sha4, targetConfigSha256: sha5, }; const classificationCounts = { 'image-recorded-not-current': 1, 'image-recorded-current-failed': 0, 'rolling-out-current-failed': 0, 'rolling-out-superseded': 0, } as const; const counts = { operationCount: 1, routeClaimsStabilized: 1, routeClaimsRemoved: 0, resourceClaimsRemoved: 1, } as const; const plan: ICloudlyLegacyDeploymentSettlementPlanV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-plan', authority: authorityReference, settlementId: 'settlement-1', effectiveAt: 1_700_000_100_000, sourceStateHmac: stateC, finalStateHmac: stateD, sourceCensus: { operations: 3, services: 2, images: 2, releases: 2, rolloutOperations: 1, routeClaims: 1, resourceClaims: 1, }, entries: [{ operationId: 'deployment-operation-1', serviceId: 'service-1', sourceRevision: 4, sourceState: 'image-recorded', classification: 'image-recorded-not-current', finalRevision: 7, sourceDocumentHmac: 'hmac-sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', finalDocumentHmac: 'hmac-sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', routeClaimsStabilized: 1, routeClaimsRemoved: 0, resourceClaimsRemoved: 1, }], classificationCounts, operationCount: 1, }; const planSha256 = 'e2a1b29678884c9a8629ba3e5887f4c0115c3ef49aed533695b2aa871505037e'; const productionRequest: ICloudlyLegacyDeploymentSettlementProductionRequestV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-production-request', authority: authorityReference, plan, planSha256, rehearsalBinding, rehearsalBindingSha256: '98749a1fb41e2f802a0bbeeeb8925de50a15f52b8f2865d1c977c9fbcbcb8dfe', requestedAt: 1_700_000_150_000, }; const productionRequestSha256 = 'c91e4bd00f508eeaaf13587d842be76987845d3771d08fbcc30da97012cc9226'; const checkResult: TCloudlyLegacyDeploymentSettlementCheckResultV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-check-result', status: 'ready', requestSha256: productionRequestSha256, planSha256, settlementId: 'settlement-1', sourceStateHmac: stateC, finalStateHmac: stateD, transactionSupported: true, disposition: 'unapplied', counts, classificationCounts, checkedAt: 1_700_000_200_000, }; const applyResult: TCloudlyLegacyDeploymentSettlementApplyResultV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-apply-result', status: 'completed', requestSha256: productionRequestSha256, planSha256, settlementId: 'settlement-1', sourceStateHmac: stateC, finalStateHmac: stateD, transactionSupported: true, disposition: 'applied', counts, classificationCounts, completedAt: 1_700_000_300_000, }; const stableOutcome: ICloudlyLegacyDeploymentSettlementStableOutcomeV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-stable-outcome', settlementId: 'settlement-1', runId: 'run-1', rehearsalBindingSha256: '98749a1fb41e2f802a0bbeeeb8925de50a15f52b8f2865d1c977c9fbcbcb8dfe', effectiveAt: 1_700_000_100_000, planSha256, sourceStateHmac: stateC, finalStateHmac: stateD, settlements: [{ operationId: plan.entries[0].operationId, finalRevision: plan.entries[0].finalRevision, finalDocumentHmac: plan.entries[0].finalDocumentHmac, }], counts, classificationCounts, }; const scratchReceipt: ICloudlyLegacyDeploymentSettlementScratchReceiptV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-scratch-receipt', authority: authorityReference, requestSha256: productionRequestSha256, stableOutcome, stableOutcomeSha256: 'ee9f3c7a270ee9bd72778e86376c40407ab47b599552e15c60838f3ab100c818', transactionCommitted: true, disposition: 'applied', completedAt: 1_700_000_400_000, payloadSha256: '6d28df2da5250974d2b658199c82a2b8b9e1e243cf7db3b9f4eeb28c3d2ed688', mac: 'uFe5SRsh-5Xp3mM1-2qPZ7ntkbtxNfEe0SVEd77wGrk', }; const productionReceipt: ICloudlyLegacyDeploymentSettlementProductionReceiptV1 = { schemaVersion: 1, kind: 'cloudly-legacy-deployment-settlement-production-receipt', authority: authorityReference, requestSha256: productionRequestSha256, scratchReceipt, scratchReceiptSha256: '83a9b1ea56ed3042dee608c853dd896a692934cc4d816ed816f42af7a5902b11', stableOutcome, stableOutcomeSha256: scratchReceipt.stableOutcomeSha256, transactionCommitted: true, disposition: 'applied', completedAt: 1_700_000_500_000, payloadSha256: '62cd50e10baa7afacf4ac741b20d2757cee1ece7f2d11eef8066c0f92951958c', mac: 'YuIpApcgi4olohdEtXKVzn-QoZTFNFZ06yaulxiy3JU', }; const authenticatedRehearsalBinding: IAuthenticatedCloudlyLegacyDeploymentSettlementRehearsalBindingV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-rehearsal-binding', authority: authorityReference, payload: rehearsalBinding, payloadSha256: '98749a1fb41e2f802a0bbeeeb8925de50a15f52b8f2865d1c977c9fbcbcb8dfe', mac: 'fKbvRIW0hawgxzkhqCfnVOUJZVNXA5oLyqbFvb_djsI', }; const authenticatedPlan: IAuthenticatedCloudlyLegacyDeploymentSettlementPlanV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-plan', authority: authorityReference, payload: plan, payloadSha256: planSha256, mac: '6_EzTk_wtq89TA6SN3aGQR0FjF3Pm0D20ZNP505REcA', }; const authenticatedProductionRequest: IAuthenticatedCloudlyLegacyDeploymentSettlementProductionRequestV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-production-request', authority: authorityReference, payload: productionRequest, payloadSha256: productionRequestSha256, mac: 'pSqhl4omrgIR51jiVc3kuj396cSR-HQE1GOE6wrY--0', }; const authenticatedCheckResult: IAuthenticatedCloudlyLegacyDeploymentSettlementCheckResultV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-check-result', authority: authorityReference, payload: checkResult, payloadSha256: '0ef262687d1a67299072f4adc3115340119311df671f3222309e8007373739cf', mac: 'XGMYSDcMy3eLrAI44h966_c5uHb1PW8mooPytgNvF0k', }; const authenticatedApplyResult: IAuthenticatedCloudlyLegacyDeploymentSettlementApplyResultV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-apply-result', authority: authorityReference, payload: applyResult, payloadSha256: 'e2c0c1e9f8cf7892b077580a41658c95e09b6a190266b5b8e75a46244f32fe6d', mac: 'UvGiM-WXOlH5S3_eDMfobJfN9XggFf8L_34xYCBNo0k', }; const authenticatedStableOutcome: IAuthenticatedCloudlyLegacyDeploymentSettlementStableOutcomeV1 = { schemaVersion: 1, kind: 'authenticated-cloudly-legacy-deployment-settlement-stable-outcome', authority: authorityReference, payload: stableOutcome, payloadSha256: 'ee9f3c7a270ee9bd72778e86376c40407ab47b599552e15c60838f3ab100c818', mac: 'fFbr-sSnZLBzpv1FEAfVBsNVxAcFqyzClX8UcPeUD30', }; export const cloudlyLegacyDeploymentSettlementGoldenVectors: Readonly = deepFreezeValue({ version: 1 as const, authority: { metadata: authorityMetadata, reference: authorityReference, metadataCanonicalSha256: 'da410b15675f0387a5266aecba70984c944cd45a9183e275438b299b42e42659', aadSha256: 'c161a176588e3f247ac791e6d17c1b0b585fb43e74a5b993875a3dc571265313', }, rehearsalBinding: { input: rehearsalBinding, canonicalSha256: '98749a1fb41e2f802a0bbeeeb8925de50a15f52b8f2865d1c977c9fbcbcb8dfe', authenticatedInput: authenticatedRehearsalBinding, authenticatedCanonicalSha256: '25e157858eb6e8fa0991f9c0912db93809fe7b9393653ab3da1ca0cd19767221', hmac: authenticatedRehearsalBinding.mac, }, plan: { input: plan, canonicalSha256: planSha256, authenticatedInput: authenticatedPlan, authenticatedCanonicalSha256: 'cb49cc46c65ff2ad5ca9441b714d3deab51ea91ab30ce8c703a16e1cbe326995', hmac: authenticatedPlan.mac, }, productionRequest: { input: productionRequest, canonicalSha256: productionRequestSha256, authenticatedInput: authenticatedProductionRequest, authenticatedCanonicalSha256: 'fe97347b4ccd6734fe84f6ef9bf3371acb8d3cb86f2264be73793120019fc892', hmac: authenticatedProductionRequest.mac, }, checkResult: { input: checkResult, canonicalSha256: '0ef262687d1a67299072f4adc3115340119311df671f3222309e8007373739cf', authenticatedInput: authenticatedCheckResult, authenticatedCanonicalSha256: 'b1a7a0b4db36113084ff984508ff409b4f2964b4974a2ed50ece41f2b525e62d', hmac: authenticatedCheckResult.mac, }, applyResult: { input: applyResult, canonicalSha256: 'e2c0c1e9f8cf7892b077580a41658c95e09b6a190266b5b8e75a46244f32fe6d', authenticatedInput: authenticatedApplyResult, authenticatedCanonicalSha256: 'dcf178cbcb59805517bee0f15ea95abec36bdae5508ead497c99acaccd2d314d', hmac: authenticatedApplyResult.mac, }, stableOutcome: { input: stableOutcome, canonicalSha256: 'ee9f3c7a270ee9bd72778e86376c40407ab47b599552e15c60838f3ab100c818', authenticatedInput: authenticatedStableOutcome, authenticatedCanonicalSha256: '985df2f46389cb4afa7b37c1f005a15869faae8ee6e010a249d47edf39819ee9', hmac: authenticatedStableOutcome.mac, }, scratchReceipt: { input: scratchReceipt, canonicalSha256: '83a9b1ea56ed3042dee608c853dd896a692934cc4d816ed816f42af7a5902b11', hmac: scratchReceipt.mac, }, productionReceipt: { input: productionReceipt, canonicalSha256: '9b4221bfd6335ad6f0095151f778933567a916e0691fc56c40893f2cb44f1a50', hmac: productionReceipt.mac, }, });