Validate entry IDs at construction - #813
Merged
Merged
Conversation
Make EntryID an opaque value constructed through NewEntryID so handlers, stores, and callers cannot pass malformed IDs. SQLite now converts IDs at SQL boundaries and rejects malformed persisted IDs while listing metadata. Tests cover EntryID validation and use valid constructor-created IDs.
Add MustCreateEntryID beside NewEntryID and use it in all test packages. Inline garbage-collection test IDs to avoid unnecessary temporary variables.
Resolve SQLite chunk query conflicts by retaining named parameters while binding validated entry IDs as strings.
Expose the domain entry ID length so generated IDs always match the constructor's validation rule.
Make EntryIDFromString explicit at parsing callsites so NewEntryID can name random entry ID generation in the next change.
Expose NewEntryID for secure ID generation and remove the upload handler's duplicate generator and alphabet. EOF && git status --short
Use a package-level character set when validating entry IDs rather than scanning the allowed-character string for each input character.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Make EntryID an opaque value constructed through NewEntryID so handlers, stores, and callers cannot pass malformed IDs. SQLite now converts IDs at SQL boundaries and rejects malformed persisted IDs while listing metadata.
Tests cover EntryID validation and use valid constructor-created IDs.