Skip to content

Validate entry IDs at construction - #813

Merged
mtlynch merged 10 commits into
masterfrom
entry-id-type
Sep 16, 2026
Merged

mtlynch merged 10 commits into
masterfrom
entry-id-type

Conversation

@mtlynch

@mtlynch mtlynch commented Sep 15, 2026

Copy link
Copy Markdown
Owner

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.

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.
@mtlynch
mtlynch enabled auto-merge (squash) September 16, 2026 12:05
@mtlynch
mtlynch merged commit 37af447 into master Sep 16, 2026
9 checks passed
@mtlynch
mtlynch deleted the entry-id-type branch September 16, 2026 12:07
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant