-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[cli] refresh VERCEL_OIDC_TOKEN
#13226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 7175457 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 |
I like this a lot more than #13214! |
8da1ed3
to
7175457
Compare
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
In order to avoid a test-e2e timeout related to the new functionality in |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@41.6.0 ### Minor Changes - `vercel dev` will now automatically refresh the `VERCEL_OIDC_TOKEN` environment ([#13226](#13226)) variable and restart the development server before it expires. ### Patch Changes - fix(auth): fix rendering fallback verification link ([#13232](#13232)) - Updated dependencies \[[`b696b2dc8e6a2bb6c9dc1c6ce99cddf375b61559`](b696b2d), [`a640944c6e2c69afab5b7f03080d8363ef4bcf5b`](a640944), [`f0730d4b77f158c75b119544ee8756a609f22fdf`](f0730d4)]: - @vercel/next@4.7.7 ## @vercel/firewall@0.1.7 ### Patch Changes - fix(readme): updated link to documentation about the SDK ([#13210](#13210)) ## @vercel/next@4.7.7 ### Patch Changes - Fix for rewrite headers that ensures that we don't check post-non rewrite operations (like adding headers). ([#13229](#13229)) - [next] ensure app router 404 page is still included in functions when using pages i18n ([#13222](#13222)) - [next] improve error message for "No Next.js version" ([#13239](#13239)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## vercel@41.6.0 ### Minor Changes - `vercel dev` will now automatically refresh the `VERCEL_OIDC_TOKEN` environment ([#13226](vercel/vercel#13226)) variable and restart the development server before it expires. ### Patch Changes - fix(auth): fix rendering fallback verification link ([#13232](vercel/vercel#13232)) - Updated dependencies \[[`8e1620805349484a3ee7944c4076c5d2c6f19ecc`](vercel/vercel@8e16208), [`134ea04feb1d534c6e6ebba8fdb2c698dc9477cf`](vercel/vercel@134ea04), [`d24262e058ee55fedfd03ab8f8197f840cd9c282`](vercel/vercel@d24262e)]: - @vercel/next@4.7.7 ## @vercel/firewall@0.1.7 ### Patch Changes - fix(readme): updated link to documentation about the SDK ([#13210](vercel/vercel#13210)) ## @vercel/next@4.7.7 ### Patch Changes - Fix for rewrite headers that ensures that we don't check post-non rewrite operations (like adding headers). ([#13229](vercel/vercel#13229)) - [next] ensure app router 404 page is still included in functions when using pages i18n ([#13222](vercel/vercel#13222)) - [next] improve error message for "No Next.js version" ([#13239](vercel/vercel#13239)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Reenable test disabled in #13436 According to `git bisect` vercel/vercel#13226 broke this behavior. Unsure of how the passed on CI/up until recently as it was definitely broken. It looks like the `AbortController` prevented the process from exiting.
If
vc dev
is left running for longer than 12 hours, theVERCEL_OIDC_TOKEN
environment variable can expire, leading to errors in applications that depend on it.This PR updates
vc dev
to proactively fetch a newVERCEL_OIDC_TOKEN
15 minutes before its expiry and restart the dev server, bypassing this issue. This is a simpler approach than the one in #13214, which updated.env.local
on disk.Note that if OIDC is disabled when
vc dev
is run or if OIDC is disabled at the time of a refresh, then refreshes will be disabled. Additionally, care is taken not to refreshVERCEL_OIDC_TOKEN
too frequently (at most once every minute). This should not be a problem in practice, because the tokens issued in development have a 12 hour expiration.For manual testing, I set the environment variables
to force
vc dev
to consider whatever token was fetched already expired and to speed up fetching the next one.