From 2f62faab6fd7ef7e37c4fe6b633664fce0a1e6cf Mon Sep 17 00:00:00 2001 From: bnewbold Date: Fri, 22 Mar 2024 14:04:02 -0700 Subject: [PATCH] lex: limit createReport size (#2362) * lex: limit createReport size This has actually be limited on the *output* for a long time, apparently as a mistake/typo when locking down string length fields earlier. Going with the existing length there (2000 graphemes). 1200 might also be good; a longer description could be a future additional field or out-of-band or something. * codegen lex changes --- lexicons/com/atproto/moderation/createReport.json | 2 ++ packages/api/src/client/lexicons.ts | 5 ++++- packages/api/src/client/types/com/atproto/sync/getRecord.ts | 2 +- packages/bsky/src/lexicon/lexicons.ts | 2 ++ packages/ozone/src/lexicon/lexicons.ts | 2 ++ packages/pds/src/lexicon/lexicons.ts | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lexicons/com/atproto/moderation/createReport.json b/lexicons/com/atproto/moderation/createReport.json index f41d28d0b15..0b8d11f3ac9 100644 --- a/lexicons/com/atproto/moderation/createReport.json +++ b/lexicons/com/atproto/moderation/createReport.json @@ -18,6 +18,8 @@ }, "reason": { "type": "string", + "maxGraphemes": 2000, + "maxLength": 20000, "description": "Additional context about the content and violation." }, "subject": { diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index c30a2e1c882..3ee6eac1f20 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -1067,6 +1067,8 @@ export const schemaDict = { }, reason: { type: 'string', + maxGraphemes: 2000, + maxLength: 20000, description: 'Additional context about the content and violation.', }, @@ -3054,7 +3056,8 @@ export const schemaDict = { commit: { type: 'string', format: 'cid', - description: 'An optional past commit CID.', + description: + 'DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit', }, }, }, diff --git a/packages/api/src/client/types/com/atproto/sync/getRecord.ts b/packages/api/src/client/types/com/atproto/sync/getRecord.ts index 1fc9a94b406..d7b9c8920a6 100644 --- a/packages/api/src/client/types/com/atproto/sync/getRecord.ts +++ b/packages/api/src/client/types/com/atproto/sync/getRecord.ts @@ -13,7 +13,7 @@ export interface QueryParams { collection: string /** Record Key */ rkey: string - /** An optional past commit CID. */ + /** DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit */ commit?: string } diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index af4614f72ba..8b2e40bd723 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -1067,6 +1067,8 @@ export const schemaDict = { }, reason: { type: 'string', + maxGraphemes: 2000, + maxLength: 20000, description: 'Additional context about the content and violation.', }, diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index 45220154eb3..3ee6eac1f20 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -1067,6 +1067,8 @@ export const schemaDict = { }, reason: { type: 'string', + maxGraphemes: 2000, + maxLength: 20000, description: 'Additional context about the content and violation.', }, diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 45220154eb3..3ee6eac1f20 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -1067,6 +1067,8 @@ export const schemaDict = { }, reason: { type: 'string', + maxGraphemes: 2000, + maxLength: 20000, description: 'Additional context about the content and violation.', },