Conversation
Due to the "len(fields[2]) < 6", the iteration count had to be at least 4 digits and lower ones were rejected. Add scram.Client.AcceptIterations() to set a lower and upper boundary instead. We could just fix it to accept any number, but using very low or very high values does not strike me as good, so require explicitly opting in. The default minimum is 1000, because that was the de-facto minimum before this. Ideally I'd like to use 4096 (PostgreSQL default, recommended minimum in RFC 5802 and 7677), but that's not compatible. RFC does not define an upper boundary; PostgreSQL does not seem to have one either. The value of 10 million was taken from pgx – that takes about 1.2s on my 7840U. --- PostgreSQL does not support setting this from the connection string or environment. Expose it as "pqgo_scram_iterations=min,max" and "PQGOSCRAMITERATIONS=min,max". Prefixing it with pqgo clarifies this is a pq extension, and won't cause any headaches in the future if PostgreSQL adds this feature. Closes #1296
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Due to the "len(fields[2]) < 6", the iteration count had to be at least 4 digits and lower ones were rejected.
Add scram.Client.AcceptIterations() to set a lower and upper boundary instead. We could just fix it to accept any number, but using very low or very high values does not strike me as good, so require explicitly opting in.
The default minimum is 1000, because that was the de-facto minimum before this. Ideally I'd like to use 4096 (PostgreSQL default, recommended minimum in RFC 5802 and 7677), but that's not compatible.
RFC does not define an upper boundary; PostgreSQL does not seem to have one either. The value of 10 million was taken from pgx – that takes about 1.2s on my 7840U.
PostgreSQL does not support setting this from the connection string or environment. Expose it as "pqgo_scram_iterations=min,max" and "PQGOSCRAMITERATIONS=min,max". Prefixing it with pqgo clarifies this is a pq extension, and won't cause any headaches in the future if PostgreSQL adds this feature.
Closes #1296