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

Fix mishandling of SASL attribute parsing #451

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Jan 30, 2024

When parsing SASL attribute strings, we were incorrectly allowing them to be split on = characters more than once per attribute. This broke for attribute values ending with =, most particularly Base64-like values, which appear often in - for example - the nonce strings sent by Supabase PostgreSQL severs.

@gwynne gwynne added the semver-patch No public API change. label Jan 30, 2024
@gwynne gwynne requested a review from fabianfett January 30, 2024 14:16
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6ce96ab) 59.92% compared to head (339b9d1) 62.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #451      +/-   ##
==========================================
+ Coverage   59.92%   62.20%   +2.28%     
==========================================
  Files         124      124              
  Lines        9937     9936       -1     
==========================================
+ Hits         5955     6181     +226     
+ Misses       3982     3755     -227     
Files Coverage Δ
...IO/Utilities/SASLAuthentication+SCRAM-SHA256.swift 47.48% <100.00%> (+47.21%) ⬆️

... and 5 files with indirect coverage changes

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

Two tiny nits! Extremely good work! Thanks so much! Love the increase in test coverage as well!

@fabianfett fabianfett merged commit e9b90b2 into main Jan 30, 2024
12 of 13 checks passed
@fabianfett fabianfett deleted the fix-base64-like-sasl-nonces branch January 30, 2024 14:28
Sherlouk added a commit to SwiftLeeds/swiftleeds-web that referenced this pull request Jan 30, 2024
Note the dependency update on PostgresNIO is necessary as the latest patch release contains a bug fix specifically introduced with Supabase's new load balancer.

vapor/postgres-nio#451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants