Skip to content

Commit

Permalink
hotfix: prevent user-supplied rkey on posts with createRecord (#1313)
Browse files Browse the repository at this point in the history
* prevent user-supplied rkey on posts with createRecord

* allow empty-string rkey parameter

Co-authored-by: devin ivy <[email protected]>

---------

Co-authored-by: devin ivy <[email protected]>
  • Loading branch information
DavidBuchanan314 and devinivy authored Jul 12, 2023
1 parent 5e34a8b commit c78d30f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/pds/src/api/com/atproto/repo/createRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export default function (server: Server, ctx: AppContext) {
'Unvalidated writes are not yet supported.',
)
}
if (collection === ids.AppBskyFeedPost && rkey) {
throw new InvalidRequestError(
'Custom rkeys for post records are not currently supported.',
)
}

const swapCommitCid = swapCommit ? CID.parse(swapCommit) : undefined

Expand Down

0 comments on commit c78d30f

Please sign in to comment.