Repository navigation
registry-client: apply VLT_TOKEN to the default registry alias - #1992
Merged
Merged
Conversation
`VLT_TOKEN` was only sent when `VLT_REGISTRY` matched, so configs with just `registries.npm` (as `vlt setup` writes) got no auth. Now it applies to `VLT_REGISTRY` if set (a `registry` scalar is exported as it), else `registries[default-registry-alias]`. Fixes #1845 ## Changes - `defaultRegistryKey()`; `getToken`/`getTokenByURL` take a default key - `RegistryClient.defaultRegistryKey` passed on request auth - query auth headers and `vlt token ls` use it - docs: default registry for `VLT_TOKEN`, env token precedence ## Tests - registry-client auth + request tests for default alias, `VLT_REGISTRY` precedence, `registry` option (`vlt registry <alias>`) not moving it, scoped/lookalike urls - cli-sdk query-auth + token list Co-authored-by: Ruy Adorno <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
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 |
|
| Project | vltpkg |
| Branch | ruyadorno/default-token |
| Testbed | ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| vlt install: vue & cache-lockfile | 📈 view plot 🚷 view threshold | 811.33 ms(+11.87%)Baseline: 725.26 ms | 906.58 ms (89.49%) |
| vlt install: vue & cache-lockfile-node-modules | 📈 view plot 🚷 view threshold | 307.76 ms(-10.88%)Baseline: 345.34 ms | 431.68 ms (71.29%) |
| vlt install: vue & clean | 📈 view plot 🚷 view threshold | 13,210.01 ms(-0.08%)Baseline: 13,220.57 ms | 16,525.71 ms (79.94%) |
| vlt install: vue & lockfile | 📈 view plot 🚷 view threshold | 5,434.43 ms(+6.84%)Baseline: 5,086.56 ms | 6,358.19 ms (85.47%) |
ruyadorno
approved these changes
Oct 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VLT_TOKENwas only sent whenVLT_REGISTRYmatched, so configs with justregistries.npm(whatvlt setupwrites) got no auth. Now it applies toVLT_REGISTRYif set (aregistryscalar is exported as it), elseregistries[default-registry-alias]. Fixes #1845Changes
defaultRegistryKey();getToken/getTokenByURLtake a default key;RegistryClient.defaultRegistryKeyused for request authvlt token lsuse itvlt registry <alias> <cmd>doesn't move the default:VLT_TOKENstays on the default aliasVLT_TOKEN; env token precedenceTests
defaultRegistryKey,getToken/getTokenByURL(default alias,VLT_REGISTRYwins, scoped/lookalike urls, precedence), request + requestStream auth headerstoken lsFollow-ups
VLT_TOKENwithoutVLT_REGISTRYwas ignored; now authenticates the default registry and beats a keychain login there.vlt logoutwithVLT_TOKENset authenticates list/revoke with it, not the keychain token being revoked; pre-existing withVLT_REGISTRY. Fix (auth logout requests with the revoked token)?main) still needsVLT_TOKEN_<registry>.Co-authored-by: Ruy Adorno [email protected]