Skip to content

feat: append random suffix to vlt registry auth token per iteration#55

Merged
lukekarrys merged 1 commit intovltpkg:mainfrom
vltbaudbot:feat/registry-auth-cache-bust
Mar 5, 2026
Merged

feat: append random suffix to vlt registry auth token per iteration#55
lukekarrys merged 1 commit intovltpkg:mainfrom
vltbaudbot:feat/registry-auth-cache-bust

Conversation

@vltbaudbot
Copy link
Contributor

Summary

When benchmarking registry.vlt.io, appends a random suffix to the VLT_REGISTRY_AUTH_TOKEN for every hyperfine iteration. The suffix is separated from the actual token with a colon (:) and is different for each run.

How it works

The BENCH_SETUP_REGISTRY_VLT prepare command now writes the auth token as:

${VLT_REGISTRY_AUTH_TOKEN}:<random-32-hex-chars>

The random part is generated at prepare-time (before each timed run) via:

head -c 16 /dev/urandom | xxd -p

This produces 32 hex characters that are unique per iteration, ensuring the registry does not serve cached responses across benchmark runs.

Example

# Iteration 1: token = abc123:ff0793fc3859f55c800bf738c6c6679f
# Iteration 2: token = abc123:c778b1c503307d638278f54b5aa0fbc6
# Iteration 3: token = abc123:a91e2f4b7c8d3e5a6012f9b8c4d7e3a1

Changes

File Change
scripts/registry/common.sh Append :$(random) to vlt auth token in prepare step

Only the vlt registry token is modified — npm and AWS registries are unchanged.

Appends a colon-separated random hex string to VLT_REGISTRY_AUTH_TOKEN
in the --prepare step for each hyperfine iteration. This ensures every
benchmark run uses a unique token, preventing the registry from serving
cached responses across iterations.

The suffix is generated at prepare-time via /dev/urandom (32 hex chars),
so each iteration gets a different value. The actual token remains the
prefix, with the random part appended after a colon separator.
@lukekarrys lukekarrys merged commit 4547b17 into vltpkg:main Mar 5, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants