Skip to content

Commit

Permalink
lex: limit createReport size (#2362)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bnewbold authored Mar 22, 2024
1 parent cb2eb58 commit 2f62faa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lexicons/com/atproto/moderation/createReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
},
"reason": {
"type": "string",
"maxGraphemes": 2000,
"maxLength": 20000,
"description": "Additional context about the content and violation."
},
"subject": {
Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ export const schemaDict = {
},
reason: {
type: 'string',
maxGraphemes: 2000,
maxLength: 20000,
description:
'Additional context about the content and violation.',
},
Expand Down Expand Up @@ -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',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ export const schemaDict = {
},
reason: {
type: 'string',
maxGraphemes: 2000,
maxLength: 20000,
description:
'Additional context about the content and violation.',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ export const schemaDict = {
},
reason: {
type: 'string',
maxGraphemes: 2000,
maxLength: 20000,
description:
'Additional context about the content and violation.',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,8 @@ export const schemaDict = {
},
reason: {
type: 'string',
maxGraphemes: 2000,
maxLength: 20000,
description:
'Additional context about the content and violation.',
},
Expand Down

0 comments on commit 2f62faa

Please sign in to comment.