From 33e0f8d0bcf1ee5843a17b187e12932e1daaeda0 Mon Sep 17 00:00:00 2001 From: Matt Wilde Date: Wed, 20 Nov 2024 13:25:22 -0500 Subject: [PATCH] cleanup --- src/lib/auth/authNZ.mjs | 2 ++ test/authNZ.mjs | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/auth/authNZ.mjs b/src/lib/auth/authNZ.mjs index 03971903..f30e0c69 100644 --- a/src/lib/auth/authNZ.mjs +++ b/src/lib/auth/authNZ.mjs @@ -17,6 +17,8 @@ export async function authNZMiddleware(argv) { // Make sure required keys are there so handlers have no issue accesssing/using. const { profile, database, role, url } = argv; // TODO: for any args that aren't passed in, get them from configuration files + + // TODO: will the account key and DB key be ping'd every time a command is run? try { const accountKey = await setAccountKey(profile); if (database) { diff --git a/test/authNZ.mjs b/test/authNZ.mjs index 913791df..55456a97 100644 --- a/test/authNZ.mjs +++ b/test/authNZ.mjs @@ -103,10 +103,6 @@ describe("authNZMiddleware", function () { }; beforeEach(() => { scope = container.createScope(); - scope.register({ - accountCreds: awilix.asClass(AccountKey).scoped(), - secretCreds: awilix.asClass(SecretKey).scoped(), - }); fs = scope.resolve("fs"); fs.readFileSync.callsFake((path) => { if (path.includes("access_keys")) { @@ -161,6 +157,7 @@ describe("authNZMiddleware", function () { // Verify the cleanup secrets logic expect(secretCreds.delete.calledOnce).to.be.true; + expect(secretCreds.delete.args[0][0]).to.equal("old-account-key"); }); }); });