You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* RUBY-1949 Add X.509 authentication integration tests
* Ensure auth source for x509 auth is always $external
* Handle x509 auth failing in x509 test when x509 auth is used globally
* Remove X509_AUTH_REQUIRED as it is no longer used
Copy file name to clipboardExpand all lines: lib/mongo/auth/x509.rb
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@
17
17
moduleMongo
18
18
moduleAuth
19
19
20
-
# Defines behavior for x.509 authentication.
20
+
# Defines behavior for X.509 authentication.
21
21
#
22
22
# @since 2.0.0
23
23
classX509
@@ -39,6 +39,16 @@ class X509
39
39
#
40
40
# @since 2.0.0
41
41
definitialize(user)
42
+
# The only valid database for X.509 authentication is $external.
43
+
ifuser.auth_source != '$external'
44
+
user_name_msg=ifuser.name
45
+
" #{user.name}"
46
+
else
47
+
''
48
+
end
49
+
raiseAuth::InvalidConfiguration,"User#{user_name_msg} specifies auth source '#{user.auth_source}', but the only valid auth source for X.509 is '$external'"
# The only valid database for X.509 authentication is $external.
70
+
ifuser.auth_source != '$external'
71
+
user_name_msg=ifuser.name
72
+
" #{user.name}"
73
+
else
74
+
''
75
+
end
76
+
raiseAuth::InvalidConfiguration,"User#{user_name_msg} specifies auth source '#{user.auth_source}', but the only valid auth source for X.509 is '$external'"
0 commit comments