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
// Create a request callback that returns a valid token.
114
137
// Create a client with a url of the form mongodb://test_user1@localhost:27018/?authMechanism=MONGODB-OIDC&directConnection=true&readPreference=secondaryPreferred and a valid OIDC request callback.
115
138
// Perform a find operation that succeeds.
116
139
// Close the client.
140
+
it('successfully authenticates',function(){
141
+
expect(async()=>{
142
+
awaitcollection.findOne();
143
+
}).to.not.throw;
144
+
});
117
145
});
118
146
119
147
describe('1.4 Multiple Principal User 2',function(){
// Create a request callback that reads in the generated test_user2 token file.
122
162
// Create a client with a url of the form mongodb://test_user2@localhost:27018/?authMechanism=MONGODB-OIDC&directConnection=true&readPreference=secondaryPreferred and a valid OIDC request callback.
123
163
// Perform a find operation that succeeds.
124
164
// Close the client.
165
+
it('successfully authenticates',function(){
166
+
expect(async()=>{
167
+
awaitcollection.findOne();
168
+
}).to.not.throw;
169
+
});
125
170
});
126
171
127
172
describe('1.5 Multiple Principal No User',function(){
// Create a client with a url of the form mongodb://localhost:27018/?authMechanism=MONGODB-OIDC&directConnection=true&readPreference=secondaryPreferred and a valid OIDC request callback.
130
187
// Assert that a find operation fails.
131
188
// Close the client.
189
+
it('fails authentication',function(){
190
+
expect(async()=>{
191
+
awaitcollection.findOne();
192
+
}).to.throw;
193
+
});
132
194
});
133
195
134
196
describe('1.6 Allowed Hosts Blocked',function(){
@@ -144,24 +206,75 @@ describe('MONGODB-OIDC', function () {
// Create a client with a url of the form mongodb://localhost:27018/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws&directConnection=true&readPreference=secondaryPreferred.
155
243
// Perform a find operation that succeeds.
156
244
// Close the client.
245
+
it('successfully authenticates',function(){
246
+
expect(async()=>{
247
+
awaitcollection.findOne();
248
+
}).to.not.throw;
249
+
});
157
250
});
158
251
159
252
describe('2.3 Multiple Principal User 2',function(){
// Set the AWS_WEB_IDENTITY_TOKEN_FILE environment variable to the location of valid test_user2 credentials.
161
269
// Create a client with a url of the form mongodb://localhost:27018/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws&directConnection=true&readPreference=secondaryPreferred.
162
270
// Perform a find operation that succeeds.
163
271
// Close the client.
164
272
// Restore the AWS_WEB_IDENTITY_TOKEN_FILE environment variable to the location of valid test_user2 credentials.
0 commit comments