-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Change ErrUnknownPlugin to a func which can take the plugin name #795
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
MySQL 8.0 brings a new authentication plugin which is enabled by default. This plugin is not yet handled by the go driver. The error message which is returned is somewhat vague and this is likely to cause confusion. The change provides the same error message but includes the plugin name which will be easier for people to lookup. So rather than returning the error: this authentication plugin is not supported we return something like: authentication plugin "caching_sha2_password" is not supported
FWIW: noticed when trying to build a new app talking to a local MySQL 8.0.11 GA version. I'd forgotten to change the default plugin to something the go driver understands. |
Thank you for this pull request. I agree that the additional information would be helpful, however I still don't think that it would be a good idea to change the current behavior. We exported the If we change |
* log missing auth plugin name * refactor auth handling * auth: fix AllowNativePasswords * auth: remove plugin name print * packets: attempt to fix writePublicKeyAuthPacket * packets: do not NUL-terminate auth switch packets * move handleAuthResult to auth * add old_password auth tests * auth: add empty old_password test * auth: add cleartext auth tests * auth: add native auth tests * auth: add caching_sha2 tests * rename init and auth packets to documented names * auth: fix plugin name for switched auth methods * buffer: optimize default branches * auth: add tests for switch to caching sha2 * auth: add tests for switch to cleartext password * auth: add tests for switch to native password * auth: sync NUL termination with official connectors * packets: handle missing NUL bytes in AuthSwitchRequests Updates #795
* log missing auth plugin name * refactor auth handling * auth: fix AllowNativePasswords * auth: remove plugin name print * packets: attempt to fix writePublicKeyAuthPacket * packets: do not NUL-terminate auth switch packets * move handleAuthResult to auth * add old_password auth tests * auth: add empty old_password test * auth: add cleartext auth tests * auth: add native auth tests * auth: add caching_sha2 tests * rename init and auth packets to documented names * auth: fix plugin name for switched auth methods * buffer: optimize default branches * auth: add tests for switch to caching sha2 * auth: add tests for switch to cleartext password * auth: add tests for switch to native password * auth: sync NUL termination with official connectors * packets: handle missing NUL bytes in AuthSwitchRequests Updates #795
Description
Change
ErrUnknownPlugin
to a func which can take the plugin nameMySQL 8.0 brings a new authentication plugin which is enabled by default. This plugin is not yet handled by the go driver.
The error message which is returned is somewhat vague and this is likely to cause confusion.
The change provides the same error message but includes the plugin name which will be easier for people to lookup. So rather than returning the error:
this authentication plugin is not supported
we return something like:
authentication plugin "caching_sha2_password" is not supported
Checklist