Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Document limits, validation #278

Merged
merged 8 commits into from
Mar 20, 2023
Merged

Conversation

tatu-at-datastax
Copy link
Contributor

@tatu-at-datastax tatu-at-datastax commented Mar 20, 2023

What this PR does:

Adds document limits to restrict size of JSON documents JSON API accepts; mostly for service protection.

Implemented:

  • Max doc size: 1M characters
  • Max doc depth: 8 levels
  • Max name length: 48 characters
  • Max String length: 16000 characters
  • Max properties per Object: 64
  • Max elements per Array: 100

Not implemented:

  • Limits to Number lengths (waiting for Jackson 2.15)

Which issue(s) this PR fixes:
Fixes #173

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Mar 20, 2023
@@ -3,16 +3,16 @@

stargate:

# disable all sgv2 exception mappers, handled differently
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reordered to be alphabetic as suggested by earlier comment in file

@tatu-at-datastax tatu-at-datastax changed the title (WIP) Add Document limits, validation Add Document limits, validation Mar 20, 2023
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review March 20, 2023 20:08
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner March 20, 2023 20:08
Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tatu-at-datastax tatu-at-datastax merged commit 45d700f into main Mar 20, 2023
@tatu-at-datastax tatu-at-datastax deleted the tatu/173-add-doc-limits branch March 20, 2023 21:29
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement document limits
3 participants