This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
forked from jackc/pgproto3
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
correctly encode CopyInResponse's format field
mark CopyDone as frontend too
Add missing GSSEncRequest
Fix malformed SASL messages
Notification response was missing the PID in the Encode function
Otherwise, appending to a slice that came from a data row could overwrite adjacent memory.
Add missing 'V' field for unlocalized severity added in PG versions 9.6 and greater. See https://www.postgresql.org/docs/current/protocol-error-fields.html
This will allow using pgmockproxy output as ingestion data for pgmock.
* AuthenticationMD5Password was wrong and is not needed * Bind was wrong * ErrorResponse is not needed * Minor improvements for reliability
Fix marshal/unmarshal for: - authentication_{cleartext_password, md5_password, ok, sasl, sasl_continue, sasl_final} - error_response
The pgprotocol overloads 'p' messages with PasswordMessage, SASLInitialResponse, SASLResponse, and GSSResponse. This patch allows contextual identification of the message by setting the authType in the frontend and then setting this value in the backend when a AuthenticationResponseMessage is received.
In the original issue [1] and commit [2], support for unexpected EOF was added to the frontend to detect when a connection was closed abruptly. Additionally, this allows us to differentiate normal io.EOF errors with unexpected errors in the backend. [1] jackc/pgx#662 [2] jackc@595780b
PG provides a maximum size for a StartupMessage: https://doxygen.postgresql.org/pqcomm_8h.html#a4c50c668c551887ac3a49872130349e3 Limiting the size ensures a malicious user doesn't send an overwhelmingly large StartupMessage which could DOS a Go binary that uses pgproto3.
Extend handling of unexpected EOF to the backend
Hex encoding the Data field in the SASL responses made debugging SCRAM more difficult than actually helping. Before: F{"Type":"SASLResponse","Data":"633d655377732c723d4d4d4e4e6d666b536f5862694a68385833466d324f2b4d77787354692f4550753052414157484b7a306b7376336c5747392f4d4a5267504d2c703d616742664b533164383937674b4f4a6d4c7171626c49326b6b4a506f2b58354359516c63473458357657343d"} F{"Type":"SASLInitialResponse","AuthMechanism":"SCRAM-SHA-256","Data":"792c2c6e3d2c723d4d4d4e4e6d666b536f5862694a68385833466d324f2b4d77"} After: F{"Type":"SASLResponse","Data":"c=eSws,r=9dR43UQLL1KbrKKl4/QbxjqgVjZYR9mqnx3rFBiI7R/1pp5oeVYMGhXj,p=b2hmuvTvWn2xN0fclm+O4TwLAarRM8xoHSN7jsKDHAU="} F{"Type":"SASLInitialResponse","AuthMechanism":"SCRAM-SHA-256","Data":"y,,n=,r=9dR43UQLL1KbrKKl4/Qbxjqg"}
Added support for FunctionCall message as per https://www.postgresql.org/docs/11/protocol-message-formats.html Adds unit test for Encode / Decode cycle and invalid message format errors. Fixes jackc#23
function whether expected or not, rather than continue and try to compare invalid decoded results. Extend the unit test slightly to check the header. Remove go-test/deep dependency in favour of standard library reflect package.
steve-bitdotio
approved these changes
Feb 14, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.