Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilde345 committed Nov 20, 2024
1 parent d12882e commit 33e0f8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/lib/auth/authNZ.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 1 addition & 4 deletions test/authNZ.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -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");
});
});
});

0 comments on commit 33e0f8d

Please sign in to comment.