vapor / postgres-nio

🐘 Non-blocking, event-driven Swift client for PostgreSQL.
https://api.vapor.codes/postgresnio/documentation/postgresnio/
MIT License
321 stars 75 forks source link

Fix mishandling of SASL attribute parsing #451

Closed gwynne closed 8 months ago

gwynne commented 8 months ago

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.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/vapor/postgres-nio/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [...IO/Utilities/SASLAuthentication+SCRAM-SHA256.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Qb3N0Z3Jlc05JTy9VdGlsaXRpZXMvU0FTTEF1dGhlbnRpY2F0aW9uK1NDUkFNLVNIQTI1Ni5zd2lmdA==) | `47.48% <100.00%> (+47.21%)` | :arrow_up: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/vapor/postgres-nio/pull/451/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor)