Skip to content

fix(server): report the CIBA inbox entries whose lookup the store refused - #991

Merged
osanderson merged 5 commits into
mainfrom
feat/ciba-lookup-not-found
Nov 26, 2026
Merged

osanderson merged 5 commits into
mainfrom
feat/ciba-lookup-not-found

Conversation

@osanderson

Copy link
Copy Markdown
Collaborator

This makes the CIBA inbox listing say which lookup failures it skips. Until now it silently skipped any entry whose lookup answered invalid_request. That included a request that is simply gone, but also a plain error from a custom store and a request record the server couldn't read as its own.

feat(storage): ErrBackchannelAuthenticationNotFound

This is a new optional sentinel, following the precedent of ErrBackchannelAuthenticationAlreadyDecided (#964). A store's LookupBackchannelAuthentication and DecideBackchannelAuthentication should wrap it for an unknown handle, and only for that: never for an outage, nor for a stored request.

  • Contract subtests: two optional subtests, for Lookup and for Decide. Each skips if the store doesn't wrap the sentinel, and fails if it also wraps ErrStoreUnavailable. A third, required subtest checks that deciding an already-decided request doesn't wrap the sentinel.
  • memstore: it wraps the sentinel in both methods, and its subtests run.

fix(server): report the lookup refusals the listing used to hide

ListBackchannelInteractions now skips an entry only when it's gone, meaning one of:

  • the lookup is unauthorized_client, because the client is no longer registered (unchanged);
  • the lookup is invalid_request wrapping the not-found sentinel.

Any other invalid_request from the lookup is now reported in the listing's joined error, the way an undecodable inbox record already is. The readable entries are still returned, and an outage is handled as before.

DenyBackchannelInteractions:

  • Unreadable entries: an unreadable entry doesn't stop the other denials. It isn't counted, it's reported in the error, and it stays in the inbox.
  • Requests gone meanwhile: a request that disappears between the listing and its denial is now treated like an already-decided one, so its stale inbox entry is removed.

LookupBackchannelInteraction's answers are unchanged.

For stores that don't wrap the sentinel yet

A custom store that returns a plain error for an unknown handle will now see such entries reported as unreadable until they expire, instead of skipped. UPGRADING.md (v0.85.1) says to wrap the sentinel.

sqlstore is in the same position until it adopts the sentinel. That change is ready, but needs a fapigo release that includes the sentinel, so it ships in a follow-up PR with sqlstore's fapigo requirement raised. Until then a sqlstore deployment would also see gone requests reported, so the two should be released close together.

Tests

  • New server tests:
    • a listing with a gone request;
    • a listing with a plain-error lookup, and with another issuer's request record;
    • a denial with a refused lookup;
    • a denial of a request that's gone meanwhile.
  • Without the fix: each fails, except the gone-request listing. That one pins today's behaviour, and its mutant is killed.
  • Mutants: six new, all killed.
  • Suites: the race suite, sqlstore and every example module pass, and lint is clean.

Nothing on the wire changes. Only the embedder-facing listing and bulk-denial APIs are affected.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

osanderson and others added 5 commits November 26, 2026 08:06
BackchannelAuthenticationStore's lookup returned a plain error for an
unknown handle, so a caller couldn't tell a request that is gone from
any other refusal a store reports the same way. The server's inbox
listing therefore left out every entry whose lookup failed that way,
hiding from the operator entries the store couldn't answer for.

Add storage.ErrBackchannelAuthenticationNotFound, which
LookupBackchannelAuthentication and DecideBackchannelAuthentication
should wrap for an unknown handle, and for nothing else. Wrapping it is
optional, as for ErrBackchannelAuthenticationAlreadyDecided. The
contract gains optional subtests that a store wrapping it does so
without also wrapping ErrStoreUnavailable, and a required one that a
second decision of a stored request doesn't wrap it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
memstore's BackchannelAuthenticationStore answered a lookup or a
decision for a handle it doesn't hold with a plain error. Both now wrap
storage.ErrBackchannelAuthenticationNotFound, so the server can tell a
request that is gone from any other refusal, and the contract's
optional subtests for the sentinel run against memstore rather than
skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ListBackchannelInteractions left out every inbox entry whose request
lookup came back invalid_request, taking it for a request gone from the
store. But the lookup answers invalid_request for any refusal a store
reports as a plain error, and for a request record the server can't
read as its own, so such entries were hidden from the operator, and an
account closure could look done while one remained.

The listing now leaves an entry out only when the store says the
request is gone (storage.ErrBackchannelAuthenticationNotFound) or its
client is no longer registered, as before. Any other refused lookup is
reported in the listing's error, with every readable request still
returned, as an undecodable inbox record already is.
DenyBackchannelInteractions goes on denying the others, doesn't count
such an entry, and leaves it in the inbox. It also takes a request the
store says is gone when it comes to deny it for a stale entry: passed
over and taken out of the inbox, like one already decided.

LookupBackchannelInteraction answers an unknown handle as before, with
the store's error as its cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin that the inbox listing leaves out only a request the store says is
gone or whose client is no longer registered, that a bulk denial clears
a request the store says is gone, and that memstore wraps
storage.ErrBackchannelAuthenticationNotFound for an unknown handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@osanderson
osanderson force-pushed the feat/ciba-lookup-not-found branch from 504fea9 to 782e504 Compare November 26, 2026 00:08
@sonarqubecloud

Copy link
Copy Markdown

@osanderson
osanderson merged commit 642dbc9 into main Nov 26, 2026
34 checks passed
@osanderson
osanderson deleted the feat/ciba-lookup-not-found branch November 26, 2026 00:50
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.

1 participant