Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

dialog auth #913

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

Closed
tpetr wants to merge 2 commits into go-sql-driver:master from tpetr:master
Closed

dialog auth #913

tpetr wants to merge 2 commits into go-sql-driver:master from tpetr:master

Conversation

@tpetr
Copy link

@tpetr tpetr commented Jan 1, 2019

Description

This PR adds support for the dialog authentication plugin. I cut some corners by leaving the DialogFunc() implementation to the user instead of attempting to load a shared library, but I think this is a good enough start. If DialogFunc() is not implemented, we simply use whatever password is defined in the DSN.

Related to #803.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

APShirley reacted with thumbs up emoji dolmen reacted with thumbs down emoji
ParseTime bool // Parse time values to time.Time
RejectReadOnly bool // Reject read-only connections

DialogFunc func(byte, string) (string, error) // Optional dialog auth implementation
Copy link
Member

@julienschmidt julienschmidt Mar 8, 2019

Choose a reason for hiding this comment

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

This should document what the default behavior is if no dialog auth implementation is provided

```

`allowCleartextPasswords=true` allows using the [cleartext client side plugin](http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
`allowCleartextPasswords=true` allows using the [cleartext client side plugin](http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html) or [dialog plugin](https://mariadb.com/kb/en/library/development-pluggable-authentication/#dialog-client-plugin)if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
Copy link

Choose a reason for hiding this comment

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

The links to dev.mysql.com appear broken to me. Might you be able to fix these?

For example, http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html
redirects me to https://dev.mysql.com/doc/refman/8.0/en/cleartext-authentication-plugin.html
which returns 404 and Page Not Found.

Copy link
Contributor

dolmen commented Jun 1, 2020
edited
Loading

Extending the mysql.Config for any authentication use case should stop. In this package we should keep the core functionality.

If people want to use an alternate way to build the DSN, they can wrap the mysql.Driver and build their own driver.Driver. See github.com/dolmen-go/mylogin-driver as an example.

Copy link

@dolmen What about this patch? Is there a plan to support PAM auth?
@tpetr Are you interested into rebasing this patch?

@methane methane modified the milestones: v1.7.0, v1.8.0 May 2, 2023
@methane methane removed this from the v1.8.0 milestone May 24, 2023
Copy link
Contributor

dolmen commented Jun 2, 2023
edited
Loading

@pierresouchay Each user who wants to implement his own authentication method can do it without polluting the go-sql-driver/mysql driver. One can create his own database/sql/driver which delegates DB connection to go-sql-driver/mysql by using NewConnector or OpenConnector. As a concrete example see the implementation of OpenConnector in github.com/dolmen-go/mylogin-driver.

Copy link
Author

tpetr commented Jun 2, 2023

Sorry for the slow response, folks. @dolmen’s approach sounds correct so I’ll close this ancient PR. Thanks everyone for the input!

@tpetr tpetr closed this Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@julienschmidt julienschmidt julienschmidt requested changes

+1 more reviewer

@cbandy cbandy cbandy left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /