File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ abstract class PostgresAuthenticator {
17
17
void onMessage (AuthenticationMessage message);
18
18
}
19
19
20
- PostgresAuthenticator createAuthenticator (PostgreSQLConnection connection) {
21
- switch (connection. authenticationScheme) {
20
+ PostgresAuthenticator createAuthenticator (PostgreSQLConnection connection, AuthenticationScheme authenticationScheme ) {
21
+ switch (authenticationScheme) {
22
22
case AuthenticationScheme .MD5 :
23
23
return MD5Authenticator (connection);
24
24
case AuthenticationScheme .SCRAM_SHA_256 :
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import 'dart:io';
6
6
import 'dart:typed_data' ;
7
7
8
8
import 'package:buffer/buffer.dart' ;
9
- import 'package:sasl_scram/sasl_scram.dart' ;
10
9
import 'auth/auth.dart' ;
11
10
12
11
import 'client_messages.dart' ;
@@ -74,9 +73,6 @@ class PostgreSQLConnection extends Object
74
73
/// Password for authenticating this connection.
75
74
final String ? password;
76
75
77
- /// AuthenticationScheme for authenticating this connection.
78
- AuthenticationScheme authenticationScheme = AuthenticationScheme .SCRAM_SHA_256 ;
79
-
80
76
/// Whether or not this connection should connect securely.
81
77
final bool useSSL;
82
78
Original file line number Diff line number Diff line change @@ -108,12 +108,10 @@ class _PostgreSQLConnectionStateAuthenticating
108
108
case AuthenticationMessage .KindOK :
109
109
return _PostgreSQLConnectionStateAuthenticated (completer);
110
110
case AuthenticationMessage .KindMD5Password :
111
- // Change default auth scheme
112
- connection! .authenticationScheme = AuthenticationScheme .MD5 ;
113
- continue authInit;
114
- authInit:
111
+ _authenticator = createAuthenticator (connection! , AuthenticationScheme .MD5 );
112
+ continue authMsg;
115
113
case AuthenticationMessage .KindSASL :
116
- _authenticator = createAuthenticator (connection! );
114
+ _authenticator = createAuthenticator (connection! , AuthenticationScheme . SCRAM_SHA_256 );
117
115
continue authMsg;
118
116
authMsg:
119
117
case AuthenticationMessage .KindSASLContinue :
You can’t perform that action at this time.
0 commit comments