Skip to content

Commit

Permalink
don't log file contents when writing via `kv:key put <key> --path <pa…
Browse files Browse the repository at this point in the history
…th>` (#111)

* don't log file contents when writing via `kv:key put <key> --path <path>`

There are a couple of reasons we don't want to log the contents; it could be secret, or it could just be very long. This commit changes the messaging to instead just say which file is being uploaded. I also took this opportunity to add a log when we're deleting a key with `kv:key delete <key>`.

* Create clever-toys-retire.md
  • Loading branch information
threepointone authored Dec 15, 2021
1 parent 9a4e334 commit cea27fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-toys-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

don't log file contents when writing via `kv:key put <key> --path <path>`
15 changes: 14 additions & 1 deletion packages/wrangler/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,16 @@ export async function main(argv: string[]): Promise<void> {
: args.value;
const config = args.config as Config;

console.log(`writing ${key}=${value} to namespace ${namespaceId}`);
if (args.path) {
console.log(
`writing the contents of ${args.path} to the key "${key}" on namespace ${namespaceId}`
);
} else {
console.log(
`writing the value "${value}" to key "${key}" on namespace ${namespaceId}`
);
}

if (args.local) {
const { Miniflare } = await import("miniflare");
const mf = new Miniflare({
Expand Down Expand Up @@ -1579,6 +1588,10 @@ export async function main(argv: string[]): Promise<void> {
async ({ key, ...args }) => {
const namespaceId = getNamespaceId(args);

console.log(
`deleting the key "${key}" on namespace ${namespaceId}`
);

if (args.local) {
const { Miniflare } = await import("miniflare");
const mf = new Miniflare({
Expand Down

0 comments on commit cea27fe

Please sign in to comment.