-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-3429 Revert internal-only "AuthenticateToAnything". #2025
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
Conversation
42b3754 to
81b9815
Compare
API Change Report./v2/mongo/optionsincompatible changes##ClientOptions.Custom: changed from ./v2/internal/options.Options to ./v2/internal/optionsutil.Options |
5e7cc5f to
5ad38c2
Compare
5ad38c2 to
16f8f28
Compare
x/mongo/driver/xoptions/options.go
Outdated
| case "authenticateToAnything": | ||
| b, ok := option.(bool) | ||
| if !ok { | ||
| return fmt.Errorf(typeErr, key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update these errors to describe the type that we want? Possible using some kind of composing function:
typeErrFuc := func() string {
return fmt.Sprintf("unexecpted type for %q, wanted %T, got %T", key, option, option)
}
x/mongo/driver/xoptions/options.go
Outdated
| import ( | ||
| "fmt" | ||
|
|
||
| internalOptions "go.mongodb.org/mongo-driver/v2/internal/options" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename the internal/options package to internal/optionsutil? That seems to follow the existing pattern. Then we can avoid aliasing imports.
x/mongo/driver/auth/auth_test.go
Outdated
|
|
||
| cases := []struct { | ||
| name string | ||
| needToPerform bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] Suggest calling this bool authenticateToAnything.
x/mongo/driver/auth/auth_test.go
Outdated
| { | ||
| name: "positive", | ||
| needToPerform: true, | ||
| assert: func(t *testing.T, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] Suggest renaming this to require.
| cases := []struct { | ||
| name string | ||
| set func(*options.ClientOptions) error | ||
| assert func(*testing.T, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Optional] Suggest renaming this to require.
GODRIVER-3429
Summary
PerformAuthenticationinHandshakeOptions.Background & Motivation