microsoft / azure-privacy-sandbox-kms

MIT License
5 stars 10 forks source link

Update key Id generation logic #136

Closed sureshchahal closed 3 weeks ago

sureshchahal commented 2 months ago

This code is already deployed in production. We had to fix issues and deploy quickly, so this is change is catching up main repo with current production logic

  1. Update keyid logic to generate keys ids between 10 and 99
  2. Removed auth from private key endpoint. For alpha, we will reply on attestation report
beejones commented 2 months ago

The CI did not pass

beejones commented 1 month ago

@sureshchahal The CI fails. Try make demo and npm run test Status: 200 Response data: {"auth":null,"description":["azure-privacy-sandbox-kms","Key Management Service","1.0.0","true"]}

✅ [PASS] - Assert OK statusCode

file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:235 const currentValue = toTest[fieldName]; ^

TypeError: Cannot read properties of null (reading 'policy') at Demo.assertField (file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:235:36) at Demo.start (file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:69:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Node.js v22.9.0

💀 Stopped sandbox process due to an error 💥 Error details: Exit Status : 1 Last Command : ${testScript} 2>&1

Error Output : No log available

make: *** [Makefile:76: demo] Error 1

Error: Dev container exec failed: (exit code: 2) Error: Dev container exec failed: (exit code: 2)

sureshchahal commented 1 month ago

@sureshchahal The CI fails. Try make demo and npm run test Status: 200 Response data: {"auth":null,"description":["azure-privacy-sandbox-kms","Key Management Service","1.0.0","true"]}

✅ [PASS] - Assert OK statusCode

file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:235 const currentValue = toTest[fieldName]; ^

TypeError: Cannot read properties of null (reading 'policy') at Demo.assertField (file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:235:36) at Demo.start (file:///workspaces/azure-privacy-sandbox-kms/test/e2e-test/src/index.ts:69:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Node.js v22.9.0

💀 Stopped sandbox process due to an error 💥 Error details: Exit Status : 1 Last Command : ${testScript} 2>&1

Error Output : No log available

make: *** [Makefile:76: demo] Error 1

Error: Dev container exec failed: (exit code: 2) Error: Dev container exec failed: (exit code: 2)

@beejones I checked CI result and all e2e tests passed. For npm run test, they pass on my local but look like CI is not able to find them. To me, it seems like a setup issue with CI rather than pull request itself. I am getting different result in local vs server. How can we move forward on this.

I am seeing this in latest CI run

_ ✅ [PASS] - Assert Member 0::key == dPcnQRbpEZXVi+Nj/T5BpHkbEu+Gjct2MFPpR0Etcl8= ✅ [PASS] - Assert Member 0::id == 100002 ✅ [PASS] - Assert headers["cache-control"] == "max-age=254838"

=============================================== 🎉 All Tests Passed...

🏁 Test Completed...

💀 Stopped sandbox process

test node --experimental-vm-modules node_modules/jest/bin/jest.js

No tests found, exiting with code 1 Run with --passWithNoTests to exit with code 0 In /workspaces/azure-privacy-sandbox-kms 143 files checked. testMatch: /test/unit-test//*.test.(ts|js|mjs) - 6 matches testPathIgnorePatterns: /node_modules/, /lib/ - 134 matches testRegex: - 0 matches Pattern: - 0 matches

Error: Dev container exec failed: (exit code: 1) Error: Dev container exec failed: (exit code: 1) _

Local Test run

Test Suites: 6 passed, 6 total Tests: 27 passed, 27 total Snapshots: 0 total Time: 1.19 s, estimated 3 s Ran all test suites.