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

[DT-824] Return 400 for invalid byte sequence #2451

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

fboulnois
Copy link
Contributor

@fboulnois fboulnois commented Jan 23, 2025

Addresses

https://broadworkbench.atlassian.net/browse/DT-824

Summary

  • A wait strategy was added for alternate container runtimes like colima, which take longer to bind the testcontainer database port. This caused tests to crash.
  • A null character (\0) anywhere in a UTF-8 string is a valid UTF-8 byte sequence, however Postgres rejects these null characters in UTF-8 strings, likely because Postgres uses null-terminated strings internally ("C-style" strings) and these can cause security issues. The error is changed such that if an invalid byte sequence is detected it returns a 400 instead.
  • Tests are added to assert that invalid names throw an error.

Have you read CONTRIBUTING.md lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@fboulnois fboulnois requested a review from a team as a code owner January 23, 2025 17:28
@fboulnois fboulnois requested review from rushtong and s-rubenstein and removed request for a team January 23, 2025 17:28
@fboulnois fboulnois force-pushed the fb-dt-824-invalid-byte-sequence branch 3 times, most recently from 4a553d6 to 646e410 Compare January 25, 2025 01:12
Copy link
Contributor

@rushtong rushtong left a comment

Choose a reason for hiding this comment

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

Nice work 👍🏽

@fboulnois fboulnois force-pushed the fb-dt-824-invalid-byte-sequence branch from 646e410 to b289ce7 Compare January 27, 2025 14:28
@fboulnois fboulnois merged commit 0e4b8e6 into develop Jan 27, 2025
14 checks passed
@fboulnois fboulnois deleted the fb-dt-824-invalid-byte-sequence branch January 27, 2025 17:45
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.

3 participants