Repository navigation
Conversation
A browser client and the field now accept only a key that starts with nipost_pk_ and refuse any other key before a request leaves, so a new secret prefix cannot slip through. client.md gets the browser rule, and field.md adds the error code unsupported_key with the text of secret_key. The spec version goes to 0.4.0. Signed-off-by: Lui Lui <40736418+lui01212@users.noreply.github.com>
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.
In a browser, a client and the field now accept only a publishable key, which starts with
nipost_pk_, and refuse any other key before a request leaves. An allow list fails safely ifa new secret prefix appears. Server clients are unchanged.
client.md gets a section on keys in a browser: trim, then classify, with one message for the
two secret prefixes and a second one for an unsupported key. field.md adds the error code
unsupported_key, which behaves assecret_keydoes and shows the same text on screen.SEC-1, TS-12, CONTEXT.md and the catalogue follow, and the spec version goes to 0.4.0.
Browser code with a key of any other prefix now stops working. Apps that use the mock server
or a custom gateway with a made-up key in a web page should check that key before they move
to 0.4.0.
Closes #14
Verification:
make checkpassed in a Linux container with Python 3.12, including 423 tests,vectors, contract validation, lint, types, licences and the offline workflow audit. Claude
Code wrote most of this change, the wording and the doc test updates, from the plan agreed
in #14.
Signed-off-by: Lui Lui 40736418+lui01212@users.noreply.github.com