• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 47091421164
89%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 03 Dec 2026 11:02AM UTC
Jobs 1
Files 1294
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Dec 2026 10:57AM UTC coverage: 88.888% (-0.02%) from 88.908%
47091421164

push

github

web-flow
feat(api): accept v1 secrets as usage report token keys

## Why
We've decided that we will accept the trade-offs of sending tokens back
and forth for the first version of this feature.

## What changed
- A v1 token key is now `v1:` plus the token's secret, exactly as the
SDK sent it. Before, it was `v1:` plus 16 hex characters.
- When the endpoint drops a v1 token key, it logs the key truncated
(`v1:aproject:development.5c806b53...`) instead of as received. Other
keys aren't secrets, so they're logged as they are.
- The schema description and examples now describe the new key, and the
Orval types are regenerated.

## Technical notes and trade-offs
- **v1 pattern is `^v1:\S{1,512}$`, not the generated `project:env.hex`
shape.** Older and admin secrets don't all follow that shape, and the
key has to match `api_tokens.secret` exactly. The pattern only rejects
what can't be a secret: an empty key, whitespace, or more than 512
characters.
- **Redaction lands first, in its own commit.** Once a v1 key is the
secret, logging dropped keys as received would write secrets to the
logs.
- **Only keys starting with `v1:` are masked, and they're truncated, not
hashed (review feedback).** The truncation reuses the OSS token mask,
now exported as `maskSecret`: it keeps the text up to the first dot plus
8 characters, or gives `<unparseable>` when there's no dot. Unlike a
hash, it keeps the project and environment readable. The check is the
`v1:` prefix rather than the strict v1 pattern, because a v1 key dropped
for whitespace or length is still a secret. Malformed keys without the
prefix are logged as received.
- **The response still echoes dropped keys unredacted.** It goes back to
the Edge that sent them, which already holds those tokens.

## How to test
1. With `unleash-postgres` up: `cd enterprise && npx vitest run
src/consumption/usage src/openapi/spec/usage-report`
2. Expected: 41 tests pass. New cases cover an empty v1 key, a key with
whitespace and a key over 5... (continued)

4335 of 5448 branches covered (79.57%)

1 of 1 new or added line in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

17238 of 19393 relevant lines covered (88.89%)

917.81 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
83.55
-0.77% src/lib/metrics.ts
1
89.58
-2.08% src/lib/features/frontend-api/client-feature-toggle-read-model.ts
Jobs
ID Job ID Ran Files Coverage
1 47091421164.1 03 Dec 2026 11:02AM UTC 1294
88.89
GitHub Action Run
Source Files on build 47091421164
  • Tree
  • List 1294
  • Changed 4
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #47091421164
  • 49802317 on github
  • Prev Build on main (#47086735538)
  • Next Build on main (#47092088050)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc