Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

support request: how to use a limited API token? #892

Closed
guaka opened this issue Nov 20, 2019 · 7 comments
Closed

support request: how to use a limited API token? #892

guaka opened this issue Nov 20, 2019 · 7 comments

Comments

@guaka
Copy link

guaka commented Nov 20, 2019

relates to #889

How to create and use a limited API token?

My global API key works but I don't want to use that for deployment from a server. So I've been trying to create a token with limited permissions.

Now, even when starting with the Edit Cloudflare Workers template, I don't manage to create a token with limited permissions that works with wrangler.

image

Could I be missing something?

Here's what I get

$ wrangler publish --verbose --env=production 
Error: [ApiError { code: 10000, message: "Authentication error", other: {} }]
$ wrangler publish --verbose    # This is on workers.dev
Error: [ApiError { code: 10000, message: "Authentication error", other: {} }]

Would be nice to get more verbosity on the error message if possible.

@EverlastingBugstopper
Copy link
Contributor

Try updating to 1.6.0! We just released support for this very feature today :) Let us know if you run into any issues

@guaka
Copy link
Author

guaka commented Nov 20, 2019

Oh nice. Unfortunately I get the same error. (I updated the issue with the commands I used and errors, around the same time you replied.)

And the global key works fine. (Well, good enough, I'm on a slow connection, so I get stuff like Error: Failed to upload file batch. ⚠️ Error: https://api.cloudflare.com/client/v4/accounts/............./stor age/kv/namespaces/.........../bulk: timed out. Which is another issue...)

@EverlastingBugstopper
Copy link
Contributor

When you updated, did you re-run wrangler config and paste your limited API token?

@guaka
Copy link
Author

guaka commented Nov 20, 2019

No I simply edited ~/.wrangler/config/default.toml - so my email was still in there.

It might help to throw an error mentioning that the email var can't be set if it's a limited API token?

Thanks!

@EverlastingBugstopper
Copy link
Contributor

Makes sense! Glad we could help :) Please come back if you run into any other issues!

@simplenotezy
Copy link

Hey @guaka - how did you solve the issue? I have the exact same issue here:

[simplenotezy:~/Projects/my-site]$ wrangler publish                                 (master✱)
🌀  Using namespace for Workers Site "__my-site-workers_sites_assets"
🌀  Uploading site files
Error: Failed to upload file batch. ⚠️  Error: error sending request for url (https://api.cloudflare.com/client/v4/accounts/XXXX/storage/kv/namespaces/XXXX/bulk): operation timed out

I got no clue why.

@guaka
Copy link
Author

guaka commented Feb 28, 2020

@simplenotezy I solved it by not using Wrangler and Workers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants