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

cameri / nostream / 43799621376
78%

Build:
DEFAULT BRANCH: main
Ran 16 Nov 2026 03:44AM UTC
Jobs 2
Files 339
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

16 Nov 2026 03:40AM UTC coverage: 77.969% (+0.1%) from 77.85%
43799621376

push

github

web-flow
fix(admin): revoke the session token at logout, not only its cookie (#1145)

## Description
`POST /admin/logout` cleared the browser cookie (`Max-Age=0`) but did
nothing to the token. An admin session token was
`<expiresAt>.<HMAC(expiresAt)>`, so it was valid for its whole lifetime
(24 hours by default) and `isRequestAuthenticated` only checked the
signature and the expiry. A copy of a token that outlived the sign-out,
for example the value a `Bearer` client sends or one that ended up in a
log or proxy, could restore administrator access after logout. The token
also carried no unique id, so two logins in the same second produced the
same token and one session could not be ended without the other.

- the token is now `<expiresAt>.<sessionId>.<signature>`: `sessionId` is
16 random bytes in hex and is signed together with the expiry;
- `handleLogout` records the session id in Redis
(`admin:session:revoked:<id>`) until the token would have expired, then
clears the cookie. Redis is the cache every worker already shares (the
NIP-98 replay claim uses it the same way), so a logout handled by one
worker ends the session on all of them;
- `isRequestAuthenticated` is now async and refuses a token whose
session id is recorded. The two admin middlewares await it;
- if Redis cannot be read the token is refused (failing closed), and a
logout that cannot record the id answers 500 and still clears the
cookie, rather than reporting a sign-out that did not happen.

Upgrade effect: tokens issued before this change have no session id and
are refused, so each administrator signs in once more. A token lasts 24
hours by default, so this costs one login.

## Related Issue
Fixes #1016

CodeRabbit's scan reported this as F-021 (medium) without establishing
reachability, so I checked the code first: `handleLogout` in
`src/admin/password-admin-auth-provider.ts` only builds the clearing
cookie, and `isValidAdminSessionToken` accepts any token with a good
signature and a future exp... (continued)

5256 of 7356 branches covered (71.45%)

Branch coverage included in aggregate %.

66 of 71 new or added lines in 5 files covered. (92.96%)

1 existing line in 1 file now uncovered.

11194 of 13742 relevant lines covered (81.46%)

678.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
80.65
src/utils/admin-session-revocations.ts
1
91.67
7.35% src/admin/password-admin-auth-provider.ts

Coverage Regressions

Lines Coverage ∆ File
1
92.39
11.93% src/utils/admin-session.ts
Jobs
ID Job ID Ran Files Coverage
1 Integration - 43799621376.1 16 Nov 2026 03:44AM UTC 339
32.75
GitHub Action Run
2 Unit - 43799621376.2 16 Nov 2026 03:45AM UTC 339
75.87
GitHub Action Run
Source Files on build 43799621376
  • Tree
  • List 339
  • Changed 7
  • Source Changed 4
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #43799621376
  • e7032cc5 on github
  • Prev Build on main (#43767531503)
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