feat: mint workspace tokens from the developers page - #686
Conversation
Add Better Auth API keys so a signed-in developer can copy a bearer token without running uploads login. Hosted keys use upl_sk_; self-hosted installs set AUTH_API_KEY_PREFIX. The CLI infers the workspace when the account has only one.
🦋 Changeset detectedLatest commit: 8839a23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Drop the Better Auth upl_sk_ key path. /account/developers now mints the same up_<workspace>_ tokens as uploads login, with a 90-day or 1-year TTL.
astro check rejects requireElement<HTMLSelectElement> because the Workers HTMLRewriter Element ambient clashes on remove(). Same cast the other select pickers already use.
In plain terms
A signed-in developer can mint a workspace token from
/account/developersand use it in curl, CI, or scripts without runninguploads login. It is the sameup_<workspace>_token the CLI already mints, not a second credential type.What it does / what it is not
/account/developersmints, lists, and revokes tokens the signed-in user created. The secret is shown once.up_<workspace>_and last 90 days by default, or 1 year. The CLI reads the workspace from the token.upl_sk_key path. There is no second prefix or user-level key.uploads loginis unchanged.How to try it
After API deploy (or
pnpm dev:stacklocally):/account/developers.Curl still names the workspace in the path:
Technical notes
POST /v1/tokens. NewGET /v1/tokens/issuedandDELETE /v1/tokens/:idare filtered byminting_user_id./v1/tokensnow uses credentialed CORS so the browser can send the session cookie, same as/v1/workspaces.apikeytable migration is gone.Test plan
/v1/tokens/account/developersagainst a running stack and PUT a file with it