deployctl icon indicating copy to clipboard operation
deployctl copied to clipboard

deployctl complains about corrupted credentials file in Windows

Open altbdoor opened this issue 1 year ago • 5 comments

$ deno --version
deno 2.1.3 (stable, release, x86_64-pc-windows-msvc)
v8 13.0.245.12-rusty
typescript 5.6.2

$ deno eval 'console.log(Deno.build)'
{
  target: "x86_64-pc-windows-msvc",
  arch: "x86_64",
  os: "windows",
  vendor: "pc",
  env: "msvc"
}

$ deployctl deployments show
ℹ Using config file 'C:\Users\[redacted]\[project-name]\deno.json'
⚠ Failed to get token from credentials file. Will provision a new token for this execution but please make sure to fix the issue afterwards.
  ✖ The credentials file has been tampered with and will be ignored. Please delete it.
ℹ Provisioning a new access token...
ℹ Authorization URL: https://dash.deno.com/signin/cli?claim_challenge=[redacted]
⠴ Waiting for authorization...

(Nearly?) all actions with deployctl will continuously open the browser to request for a new token.

Checking through the source code, I believe it is because deployctl checks for the permission of the ~/.deno/deployctl/credentials.json file.

https://github.com/denoland/deployctl/blob/873e36ef145b98c8762b777e2b1532e4096f4f94/src/utils/token_storage/fs.ts#L3-L10

This wouldn't really work on Windows, since it does not support Unix style permission flags.

As a recommendation, perhaps we could completely ignore the permission check, if the OS is Windows?

altbdoor avatar Dec 07 '24 14:12 altbdoor

I have the same issue.

ZYinMD avatar Jan 04 '25 04:01 ZYinMD

This is extremely annoying and opinionated? Why are you checking the permissions of the file. Also, if you're going to check them, at least do it in an os agnostic way.

beigexperience avatar Jan 30 '25 16:01 beigexperience

Happening to me too on Windows 11

markallisongit avatar Feb 08 '25 05:02 markallisongit

can we get a config/flag to disable this or do we need to manually rip out parts of the code ourselves?

beigexperience avatar Mar 05 '25 21:03 beigexperience

Workaround: use --token or set the DENO_DEPLOY_TOKEN env var

hansSchall avatar Apr 23 '25 16:04 hansSchall