Skip to content

Commit 1d01ccb

Browse files
committed
Merge branch 'fulghum/vitess_auth_refactor' into fulghum-843d10a6
2 parents 07efc57 + 00d873c commit 1d01ccb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sql/mysql_db/auth.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package mysql_db
1717
import (
1818
"bytes"
1919
"crypto/sha1"
20-
"crypto/x509"
2120
"encoding/hex"
2221
"net"
2322

@@ -108,7 +107,7 @@ var _ mysql.CachingStorage = (*noopCachingStorage)(nil)
108107
//
109108
// This implementation also handles authentication when a client doesn't send an auth response and
110109
// the associated user account does not have a password set.
111-
func (n noopCachingStorage) UserEntryWithCacheHash(_ []*x509.Certificate, _ []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, mysql.CacheState, error) {
110+
func (n noopCachingStorage) UserEntryWithCacheHash(_ *mysql.Conn, _ []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, mysql.CacheState, error) {
112111
db := n.db
113112

114113
// If there is no mysql database of user info, then don't approve or reject, since we can't look at
@@ -167,7 +166,7 @@ var _ mysql.PlainTextStorage = (*sha2PlainTextStorage)(nil)
167166

168167
// UserEntryWithPassword implements the mysql.PlainTextStorage interface.
169168
// The auth framework in Vitess also passes in user certificates, but we don't support that feature yet.
170-
func (s sha2PlainTextStorage) UserEntryWithPassword(_ []*x509.Certificate, user string, password string, remoteAddr net.Addr) (mysql.Getter, error) {
169+
func (s sha2PlainTextStorage) UserEntryWithPassword(_ *mysql.Conn, user string, password string, remoteAddr net.Addr) (mysql.Getter, error) {
171170
db := s.db
172171

173172
host, err := extractHostAddress(remoteAddr)
@@ -230,7 +229,7 @@ var _ mysql.PlainTextStorage = (*extendedAuthPlainTextStorage)(nil)
230229
// UserEntryWithPassword implements the mysql.PlainTextStorage interface. This method is called by the
231230
// MySQL clear password auth method to authenticate a user with a custom PlaintextAuthPlugin that was
232231
// previously registered with the MySQLDb instance.
233-
func (f extendedAuthPlainTextStorage) UserEntryWithPassword(userCerts []*x509.Certificate, user string, password string, remoteAddr net.Addr) (mysql.Getter, error) {
232+
func (f extendedAuthPlainTextStorage) UserEntryWithPassword(conn *mysql.Conn, user string, password string, remoteAddr net.Addr) (mysql.Getter, error) {
234233
db := f.db
235234

236235
host, err := extractHostAddress(remoteAddr)
@@ -330,7 +329,7 @@ var _ mysql.HashStorage = (*nativePasswordHashStorage)(nil)
330329

331330
// UserEntryWithHash implements the mysql.HashStorage interface. This implementation is called by the MySQL
332331
// native password auth method to validate a password hash with the user's stored password hash.
333-
func (nphs *nativePasswordHashStorage) UserEntryWithHash(_ []*x509.Certificate, salt []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, error) {
332+
func (nphs *nativePasswordHashStorage) UserEntryWithHash(_ *mysql.Conn, salt []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, error) {
334333
db := nphs.db
335334

336335
host, err := extractHostAddress(remoteAddr)

0 commit comments

Comments
 (0)