feat(vault): name the record a superseded read serves - #369
Merged
LKSNDRTMLKV merged 1 commit intoSep 17, 2026
Merged
Conversation
LKSNDRTMLKV
force-pushed
the
feat/superseded-read-says-so-in-content-location
branch
from
September 17, 2026 13:49
5e290d1 to
fb4bc8c
Compare
LKSNDRTMLKV
deleted the
feat/superseded-read-says-so-in-content-location
branch
September 17, 2026 13:57
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.
Closes #363.
#354 made
GET /vault/public/dpp/{dppId}serve the successor's record when the passport asked for is superseded. That is right for what the route actually is — a printed data carrier under ESPR Art. 9(1) cannot be recalled, so the door has to keep landing on whichever record is current — but it leaves a200whose body is not the resource that was requested, and nothing said so at the protocol layer.A human following a QR code never notices. A client asserting
response.id == requested_iddoes, and is right to.What it does
Content-Locationon the superseded branch only, naming the record actually served. RFC 9110 §8.7 is precisely this case: the representation is available at another URI and the response is still a200for the one asked for, which is what the carrier needs.Its presence is the signal. An ordinary read carries no such header, so a client does not have to parse the value to learn anything — receiving it at all means "this is not the record you asked for". That is why the test asserts both directions.
Two decisions
A relative reference,
./{id}. This router is mounted at/vaultby the node and at the root when the vault runs standalone, so no absolute path is correct in both../Yresolved against…/public/dpp/Xgives…/public/dpp/Yunder either mount, which is what RFC 9110 permits apartial-URIto do.A header rather than a redirect. A
301/303says the same thing and costs more: the resolver, the HTML, JSON-LD and AAS doors all sit in front of this route, so a redirect is four behaviours to re-verify rather than one header to add — and/01/{gtin}beside it does not redirect either, so redirecting here would make the two doors disagree again in the opposite direction. The served body is the successor's own signed view and itssupersedesIdalready names the passport that was scanned; the header just surfaces that for a client that has not parsed the body yet.Incidental
successor_view's return became a namedSuccessorViewstruct. It needed a fourth member — the id, which is what the header names — andview.0/view.1/view.2at the call site was already at the edge of readable. No behaviour change.Tests
Extended
an_amended_passports_printed_carrier_lands_on_the_successor, which already drives this exact path through the assembled node:./{successorId}, on the read after.Run against Docker: 1/1.
The OpenAPI documents it under
headerson the200, beside the paragraph #354 added aboutidnot always beingdppId. Bundles regenerated;redocly lintclean.just checkgreen.