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

Advertise SCRAM / SASL support in addition to PLAIN #4113

Merged
merged 34 commits into from Mar 7, 2024

Conversation

henvic
Copy link
Contributor

@henvic henvic commented Feb 22, 2024

Description

  • Add SCRAM SHA-1 and SHA-256 to getParameter command.
  • Add SASL Supported Mechanisms to hello command.

Closes #3778.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@henvic henvic self-assigned this Feb 22, 2024
@henvic henvic added the code/feature Some user-visible feature is not implemented yet label Feb 22, 2024
@henvic henvic added this to the Next milestone Feb 22, 2024
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 76.11940% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 73.78%. Comparing base (5a5ca29) to head (ceadf72).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   74.31%   73.78%   -0.53%     
==========================================
  Files         353      353              
  Lines       22738    22789      +51     
==========================================
- Hits        16897    16816      -81     
- Misses       4552     4693     +141     
+ Partials     1289     1280       -9     
Files Coverage Δ
integration/setup/helpers.go 93.93% <ø> (+15.15%) ⬆️
internal/handler/msg_getparameter.go 93.42% <100.00%> (ø)
internal/handler/msg_usersinfo.go 76.72% <100.00%> (ø)
internal/handler/msg_hello.go 75.34% <75.38%> (-15.57%) ⬇️

... and 12 files with indirect coverage changes

Flag Coverage Δ
filter-true 67.22% <76.11%> (-0.60%) ⬇️
hana-1 ?
integration 67.22% <76.11%> (-0.60%) ⬇️
mongodb-1 4.87% <0.00%> (+0.13%) ⬆️
postgresql-1 48.43% <26.86%> (+0.24%) ⬆️
postgresql-2 47.20% <26.86%> (-1.39%) ⬇️
postgresql-3 49.41% <74.62%> (+0.32%) ⬆️
sqlite-1 47.57% <26.86%> (+0.23%) ⬆️
sqlite-2 46.36% <26.86%> (-1.43%) ⬇️
sqlite-3 48.64% <74.62%> (+0.46%) ⬆️
unit 32.49% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@henvic henvic changed the title Advertise SCRAM / SASL Supported Authentication Mechanisms in addition to PLAIN Advertise SCRAM / SASL support in addition to PLAIN Feb 26, 2024
@henvic henvic marked this pull request as ready for review February 26, 2024 09:28
@henvic henvic requested a review from a team as a code owner February 26, 2024 09:28
@henvic henvic enabled auto-merge (squash) February 26, 2024 09:29
Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Just a small comment 🤗

integration/hello_command_test.go Outdated Show resolved Hide resolved
internal/handler/msg_usersinfo.go Outdated Show resolved Hide resolved
chilagrow
chilagrow previously approved these changes Mar 4, 2024
rumyantseva
rumyantseva previously approved these changes Mar 4, 2024
Copy link
Member

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

There are three quirks that I pointed out many times over multiple PRs:

  1. The usage of else when the code without it would be easier to understand (by having fewer branches). That's a generalization of https://go.dev/wiki/CodeReviewComments#indent-error-flow that is already mentioned in CONTRIBUTING.md, but we probably could add to the list of our idiosyncrasies.
  2. The usage of assert instead of require even if the test can't continue. That small detail becomes pretty important when we add another backend – the test process crashes instead of just marking a test as a failure.
  3. The creation of new test helpers. I don't think the more, the merrier rule applies there – the list of existing helpers one has to check to decide if they should be used or not should be smaller, not larger, especially if some of them are used only once.

So please be aware of those things and try not to repeat them again.
@FerretDB/core, please don't ignore those things in your reviews.

integration/hello_command_test.go Outdated Show resolved Hide resolved
integration/hello_command_test.go Outdated Show resolved Hide resolved
integration/hello_command_test.go Outdated Show resolved Hide resolved
integration/users/usersinfo_test.go Outdated Show resolved Hide resolved
integration/users/usersinfo_test.go Outdated Show resolved Hide resolved
integration/users/usersinfo_test.go Outdated Show resolved Hide resolved
@henvic henvic dismissed stale reviews from chilagrow and rumyantseva via efd071b March 5, 2024 21:31
@henvic henvic requested a review from AlekSi March 5, 2024 23:14
Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Very minor comments

integration/hello_command_test.go Outdated Show resolved Hide resolved
internal/handler/msg_hello.go Outdated Show resolved Hide resolved
integration/users/usersinfo_test.go Outdated Show resolved Hide resolved
Copy link
Member

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

LGTM

@henvic henvic merged commit 892780a into FerretDB:main Mar 7, 2024
28 checks passed
@AlekSi AlekSi added code/chore Code maintenance improvements and removed code/feature Some user-visible feature is not implemented yet labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support saslSupportedMechs
5 participants