sec(gists): guarantee backend-submitted posts are always anonymous on-chain - #1062
Conversation
…us on-chain - Ensure GistsService.create always passes author = undefined (anonymous) to SorobanService.postGist regardless of authorAddress in CreateGistDto. - Document in CreateGistDto and Backend/README.md that authorAddress is used only as an off-chain display/filter hint, and signed posts are wallet-direct. - Add regression unit test in gists.service.spec.ts. Closes PinSpace-Org#1040
BigBen-7
left a comment
There was a problem hiding this comment.
Clean, precise fix, prismn. Reviewed and tested locally: npm run build clean, full suite 14 suites, 125 passed + 1 todo, 0 failures.
The core change is exactly right: postGist is now hardcoded to undefined for the author regardless of what the client supplies, while the off-chain author_address DB column (display/filter hint) is preserved separately — correct separation of on-chain authority from off-chain metadata. The regression test is genuinely meaningful: it supplies an authorAddress in the DTO and asserts postGist was still called with undefined, which is the actual security property this issue asked for, not just a superficial check. DTO docs and README updated consistently.
No conflicts, no dependency issues. Approving and merging.
Summary
Guarantees that backend-submitted posts are provably anonymous (
author = None) on-chain.Changes
GistsService.createto explicitly passundefined(anonymous) toSorobanService.postGist.authorAddressis an off-chain hint.gists.service.spec.ts.Closes #1040