⚙️ Enhance caching mechanism and add refresh option for secret retrieval
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env -S deno run -A
|
||||
|
||||
import {args, exit, getSecretValue,} from "https://script.hatter.ink/@62/deno-commons-mod.ts";
|
||||
import {args, exit, getSecretValue,} from "https://script.hatter.ink/@66/deno-commons-mod.ts";
|
||||
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||
|
||||
const flags = parseArgs(args(), {
|
||||
boolean: ["help"],
|
||||
boolean: ["help", "refresh"],
|
||||
string: ["id"],
|
||||
});
|
||||
|
||||
@@ -19,7 +19,11 @@ if (flags.help) {
|
||||
}
|
||||
|
||||
if (flags.id) {
|
||||
console.log(await getSecretValue(flags.id));
|
||||
console.log(
|
||||
await getSecretValue(flags.id, {
|
||||
tryRefresh: flags.refresh,
|
||||
}),
|
||||
);
|
||||
exit(0);
|
||||
} else {
|
||||
console.error("get-secret.ts --id is required");
|
||||
|
||||
Reference in New Issue
Block a user