@@ -208,8 +208,9 @@ mod auth {
208208 let expired_at = Utc :: now ( ) + Duration :: days ( 7 ) ;
209209
210210 let ( app, _, client) = prepare ( ) . await ;
211- let client =
212- client. db_new_scoped_token ( "test-token" , None , None , Some ( expired_at. naive_utc ( ) ) ) ;
211+ let client = client
212+ . db_new_scoped_token ( "test-token" , None , None , Some ( expired_at. naive_utc ( ) ) )
213+ . await ;
213214
214215 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
215216 assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
@@ -227,8 +228,9 @@ mod auth {
227228 let expired_at = Utc :: now ( ) - Duration :: days ( 7 ) ;
228229
229230 let ( app, _, client) = prepare ( ) . await ;
230- let client =
231- client. db_new_scoped_token ( "test-token" , None , None , Some ( expired_at. naive_utc ( ) ) ) ;
231+ let client = client
232+ . db_new_scoped_token ( "test-token" , None , None , Some ( expired_at. naive_utc ( ) ) )
233+ . await ;
232234
233235 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
234236 assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
@@ -244,8 +246,9 @@ mod auth {
244246 #[ tokio:: test( flavor = "multi_thread" ) ]
245247 async fn token_user_with_correct_endpoint_scope ( ) {
246248 let ( app, _, client) = prepare ( ) . await ;
247- let client =
248- client. db_new_scoped_token ( "test-token" , None , Some ( vec ! [ EndpointScope :: Yank ] ) , None ) ;
249+ let client = client
250+ . db_new_scoped_token ( "test-token" , None , Some ( vec ! [ EndpointScope :: Yank ] ) , None )
251+ . await ;
249252
250253 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
251254 assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
@@ -261,12 +264,14 @@ mod auth {
261264 #[ tokio:: test( flavor = "multi_thread" ) ]
262265 async fn token_user_with_incorrect_endpoint_scope ( ) {
263266 let ( app, _, client) = prepare ( ) . await ;
264- let client = client. db_new_scoped_token (
265- "test-token" ,
266- None ,
267- Some ( vec ! [ EndpointScope :: PublishUpdate ] ) ,
268- None ,
269- ) ;
267+ let client = client
268+ . db_new_scoped_token (
269+ "test-token" ,
270+ None ,
271+ Some ( vec ! [ EndpointScope :: PublishUpdate ] ) ,
272+ None ,
273+ )
274+ . await ;
270275
271276 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
272277 assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
@@ -282,12 +287,14 @@ mod auth {
282287 #[ tokio:: test( flavor = "multi_thread" ) ]
283288 async fn token_user_with_correct_crate_scope ( ) {
284289 let ( app, _, client) = prepare ( ) . await ;
285- let client = client. db_new_scoped_token (
286- "test-token" ,
287- Some ( vec ! [ CrateScope :: try_from( CRATE_NAME ) . unwrap( ) ] ) ,
288- None ,
289- None ,
290- ) ;
290+ let client = client
291+ . db_new_scoped_token (
292+ "test-token" ,
293+ Some ( vec ! [ CrateScope :: try_from( CRATE_NAME ) . unwrap( ) ] ) ,
294+ None ,
295+ None ,
296+ )
297+ . await ;
291298
292299 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
293300 assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
@@ -304,12 +311,14 @@ mod auth {
304311 async fn token_user_with_correct_wildcard_crate_scope ( ) {
305312 let ( app, _, client) = prepare ( ) . await ;
306313 let wildcard = format ! ( "{}*" , CRATE_NAME . chars( ) . next( ) . unwrap( ) ) ;
307- let client = client. db_new_scoped_token (
308- "test-token" ,
309- Some ( vec ! [ CrateScope :: try_from( wildcard) . unwrap( ) ] ) ,
310- None ,
311- None ,
312- ) ;
314+ let client = client
315+ . db_new_scoped_token (
316+ "test-token" ,
317+ Some ( vec ! [ CrateScope :: try_from( wildcard) . unwrap( ) ] ) ,
318+ None ,
319+ None ,
320+ )
321+ . await ;
313322
314323 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
315324 assert_eq ! ( response. status( ) , StatusCode :: OK ) ;
@@ -325,12 +334,14 @@ mod auth {
325334 #[ tokio:: test( flavor = "multi_thread" ) ]
326335 async fn token_user_with_incorrect_crate_scope ( ) {
327336 let ( app, _, client) = prepare ( ) . await ;
328- let client = client. db_new_scoped_token (
329- "test-token" ,
330- Some ( vec ! [ CrateScope :: try_from( "foo" ) . unwrap( ) ] ) ,
331- None ,
332- None ,
333- ) ;
337+ let client = client
338+ . db_new_scoped_token (
339+ "test-token" ,
340+ Some ( vec ! [ CrateScope :: try_from( "foo" ) . unwrap( ) ] ) ,
341+ None ,
342+ None ,
343+ )
344+ . await ;
334345
335346 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
336347 assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
@@ -346,12 +357,14 @@ mod auth {
346357 #[ tokio:: test( flavor = "multi_thread" ) ]
347358 async fn token_user_with_incorrect_wildcard_crate_scope ( ) {
348359 let ( app, _, client) = prepare ( ) . await ;
349- let client = client. db_new_scoped_token (
350- "test-token" ,
351- Some ( vec ! [ CrateScope :: try_from( "foo*" ) . unwrap( ) ] ) ,
352- None ,
353- None ,
354- ) ;
360+ let client = client
361+ . db_new_scoped_token (
362+ "test-token" ,
363+ Some ( vec ! [ CrateScope :: try_from( "foo*" ) . unwrap( ) ] ) ,
364+ None ,
365+ None ,
366+ )
367+ . await ;
355368
356369 let response = client. yank ( CRATE_NAME , CRATE_VERSION ) . await ;
357370 assert_eq ! ( response. status( ) , StatusCode :: FORBIDDEN ) ;
0 commit comments