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 PLAIN auth with C# driver #3012

Merged
merged 40 commits into from
Jul 24, 2023
Merged

Fix PLAIN auth with C# driver #3012

merged 40 commits into from
Jul 24, 2023

Conversation

b1ron
Copy link
Contributor

@b1ron b1ron commented Jul 9, 2023

Description

Closes #2516.

[upd] from @rumyantseva: I added a unit test, but I decided against restructuring because it will bring more cyclomatic complexity, and I believe that's the exact reason why things are structured as they are right now.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • 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), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@mergify mergify bot assigned b1ron Jul 9, 2023
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Merging #3012 (e949c88) into main (bac7da5) will decrease coverage by 0.10%.
The diff coverage is 59.84%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3012      +/-   ##
==========================================
- Coverage   76.54%   76.44%   -0.10%     
==========================================
  Files         388      390       +2     
  Lines       21292    21312      +20     
==========================================
- Hits        16297    16291       -6     
- Misses       4066     4095      +29     
+ Partials      929      926       -3     
Impacted Files Coverage Δ
internal/handlers/pg/msg_saslstart.go 41.17% <0.00%> (-0.34%) ⬇️
internal/handlers/pg/cmd_query.go 19.04% <17.50%> (-59.53%) ⬇️
internal/handlers/common/saslstart.go 40.74% <38.09%> (-15.15%) ⬇️
internal/handlers/sqlite/cmd_query.go 30.76% <40.00%> (-50.72%) ⬇️
internal/handlers/common/ismaster.go 100.00% <100.00%> (ø)
internal/handlers/common/saslstart_plain.go 100.00% <100.00%> (ø)
internal/handlers/pg/msg_ismaster.go 100.00% <100.00%> (ø)
internal/handlers/sqlite/msg_ismaster.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Flag Coverage Δ
integration 72.93% <46.21%> (-0.19%) ⬇️
mongodb 5.48% <0.00%> (-0.01%) ⬇️
pg 66.36% <41.66%> (-0.09%) ⬇️
shard-1 56.80% <46.21%> (-0.17%) ⬇️
shard-2 54.94% <46.21%> (-0.20%) ⬇️
shard-3 57.01% <46.21%> (-0.20%) ⬇️
sqlite 46.44% <19.69%> (-0.05%) ⬇️
unit 24.27% <28.03%> (+0.27%) ⬆️

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

@b1ron b1ron marked this pull request as ready for review July 10, 2023 08:29
@b1ron b1ron requested a review from a team as a code owner July 10, 2023 08:29
@b1ron b1ron requested review from AlekSi and rumyantseva July 10, 2023 08:29
@b1ron b1ron added the code/bug Some user-visible feature works incorrectly label Jul 10, 2023
@b1ron b1ron requested review from a team, quasilyte, chilagrow and noisersup July 10, 2023 08:31
@b1ron b1ron enabled auto-merge (squash) July 10, 2023 08:31
@AlekSi AlekSi added trust PRs that can access Actions secrets packages PRs that should build packages labels Jul 10, 2023
@AlekSi AlekSi added this to the Next milestone Jul 10, 2023
Copy link
Member

@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 few comments 🤗

internal/handlers/pg/cmd_query.go Outdated Show resolved Hide resolved
internal/handlers/sqlite/cmd_query.go Outdated Show resolved Hide resolved
internal/handlers/pg/cmd_query.go Outdated Show resolved Hide resolved
internal/handlers/pg/cmd_query.go Outdated Show resolved Hide resolved
@b1ron
Copy link
Contributor Author

b1ron commented Jul 10, 2023

Setting the API version in the client forces OP_MSG to be used during the handshake and avoids all this messiness. See https://jira.mongodb.org/browse/CSHARP-3516.

@b1ron b1ron closed this Jul 10, 2023
auto-merge was automatically disabled July 10, 2023 17:27

Pull request was closed

@b1ron b1ron reopened this Jul 11, 2023
@rumyantseva rumyantseva requested review from a team, quasilyte and noisersup July 20, 2023 11:34
@rumyantseva rumyantseva marked this pull request as ready for review July 20, 2023 11:35
@rumyantseva rumyantseva enabled auto-merge (squash) July 20, 2023 11:35
internal/handlers/common/ismaster.go Outdated Show resolved Hide resolved
internal/handlers/common/saslstart.go Outdated Show resolved Hide resolved
internal/handlers/common/ismaster.go Outdated Show resolved Hide resolved
internal/handlers/common/saslstart_plain_test.go Outdated Show resolved Hide resolved
internal/handlers/common/saslstart_plain.go Outdated Show resolved Hide resolved
@rumyantseva rumyantseva requested a review from AlekSi July 20, 2023 14:20
noisersup
noisersup previously approved these changes Jul 20, 2023
chilagrow
chilagrow previously approved these changes Jul 21, 2023
Copy link
Member

@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 minor comments, looks good!

internal/handlers/pg/cmd_query.go Show resolved Hide resolved
internal/handlers/common/saslstart.go Show resolved Hide resolved
internal/handlers/common/saslstart_plain.go Show resolved Hide resolved
@rumyantseva rumyantseva dismissed stale reviews from noisersup and chilagrow via f6f252c July 21, 2023 06:04
@rumyantseva rumyantseva merged commit 253c72f into FerretDB:main Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Some user-visible feature works incorrectly
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Can't connect by C# MongoDB Driver
6 participants