Repository navigation
Record people by id in proposals, never by name - #36
Merged
Merged
Conversation
An accepted proposal sealed a name the host chose into the new snapshot, inside its checksum. A name there can't be taken out when a person leaves a site, and a published version may already be pinned and cited. The plugin now stores and seals only an opaque person id (proposals.personId, default the user document's id). It refuses anything that isn't a plain id, so an email address or a name with a space never passes, and it never logs a refused value. A display name comes from the optional proposals.displayName, looked up each time a proposal is read and returned as authorName; it is never stored. proposals.nameOf is removed. The plugin has not been published, so nothing released changes. Core still seals the strings it is given; only its comments and one error text changed. The example site shows the handle through displayName. Tested: 526 unit tests (142 in the plugin, on Payload 3.93 with an in-memory MongoDB), the example's 47 smoke checks on next dev and on the built site, and eight deliberate breaks of the new code, each caught. Not tested: Postgres or SQLite, or a host with more than one auth collection. A one-word handle still passes the id pattern, and titles and notes are sealed as written; the README says both. Co-Authored-By: Claude <noreply@anthropic.com>
The status line still said 139 tests; the person id change made it 142. Co-Authored-By: Claude <noreply@anthropic.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.
Why
An accepted proposal sealed a name the host chose (
proposals.nameOf) into the new snapshot, inside its checksum. A name there can't be taken out when a person leaves a site, and a published version may already be pinned and cited.What changes
proposals.personId({ req })gives an opaque id (default: the signed-in user's document id). That id is all a proposal stores about its author, and all an accepted proposal seals for the author and the manager..,_,:and-, starting with a letter or digit. An email address or a name with a space is refused: the action stops, nothing is saved, and the refused value isn't logged.proposals.displayName({ req, personId })is optional. It is looked up each time a proposal is read (once per person per request) and returned asauthorName. It is never stored or sealed.proposals.nameOfis removed. The plugin isn't on npm, so nothing released changes.displayName.Tested
next devand on the built site.Not tested, and limits
🤖 Generated with Claude Code