File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -418,6 +418,36 @@ Caused by:
418418 . run ( ) ;
419419}
420420
421+ #[ cargo_test]
422+ fn incorrect_token_bearer_scheme ( ) {
423+ let _registry = RegistryBuilder :: new ( )
424+ . alternative ( )
425+ . auth_required ( )
426+ . no_configure_token ( )
427+ . http_index ( )
428+ . build ( ) ;
429+
430+ let p = make_project ( ) ;
431+ cargo ( & p, "build" )
432+ . env ( "CARGO_REGISTRIES_ALTERNATIVE_TOKEN" , "Bearer incorrect" )
433+ . with_status ( 101 )
434+ . with_stderr_data ( str![ [ r#"
435+ [UPDATING] `alternative` index
436+ [ERROR] failed to get `bar` as a dependency of package `foo v0.0.1 ([ROOT]/foo)`
437+
438+ Caused by:
439+ token rejected for `alternative`, please run `cargo login --registry alternative`
440+ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN
441+
442+ Caused by:
443+ failed to get successful HTTP response from `http://127.0.0.1:[..]/index/config.json`, got 401
444+ body:
445+ Unauthorized message from server.
446+
447+ "# ] ] )
448+ . run ( ) ;
449+ }
450+
421451#[ cargo_test]
422452fn anonymous_alt_registry ( ) {
423453 // An alternative registry that requires auth, but is not in the config.
You can’t perform that action at this time.
0 commit comments