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
end.toraise_error(Mongo::Auth::Unauthorized,'User nonexistent_user (mechanism: scram) is not authorized to access admin (used mechanism: SCRAM-SHA-1)')
45
+
end
46
+
end
47
+
48
+
context'scram-sha-256 server'do
49
+
min_server_fcv'4.0'
50
+
51
+
# An existing user on 4.0+ will negotiate scram-sha-256.
52
+
# A non-existing user on 4.0+ will negotiate scram-sha-1.
53
+
it'indicates scram-sha-1 was used'do
54
+
expectdo
55
+
connection.connect!
56
+
end.toraise_error(Mongo::Auth::Unauthorized,'User nonexistent_user (mechanism: scram) is not authorized to access admin (used mechanism: SCRAM-SHA-1)')
end.toraise_error(Mongo::Auth::Unauthorized,"User existing_user (mechanism: scram) is not authorized to access admin (used mechanism: SCRAM-SHA-1)")
77
+
end
78
+
end
79
+
80
+
context'scram-sha-256 server'do
81
+
min_server_fcv'4.0'
82
+
83
+
# An existing user on 4.0+ will negotiate scram-sha-256.
84
+
# A non-existing user on 4.0+ will negotiate scram-sha-1.
85
+
it'indicates scram-sha-256 was used'do
86
+
expectdo
87
+
connection.connect!
88
+
end.toraise_error(Mongo::Auth::Unauthorized,"User existing_user (mechanism: scram256) is not authorized to access admin (used mechanism: SCRAM-SHA-256)")
it'indicates scram-sha-1 was requested and used'do
102
+
expectdo
103
+
connection.connect!
104
+
end.toraise_error(Mongo::Auth::Unauthorized,'User nonexistent_user (mechanism: scram) is not authorized to access admin (used mechanism: SCRAM-SHA-1)')
it'indicates scram-sha-256 was requested and used'do
115
+
expectdo
116
+
connection.connect!
117
+
end.toraise_error(Mongo::Auth::Unauthorized,'User nonexistent_user (mechanism: scram256) is not authorized to access admin (used mechanism: SCRAM-SHA-256)')
0 commit comments