@@ -83,11 +83,13 @@ fn get_token_test() -> (Project, TestRegistry) {
83
83
) )
84
84
. alternative ( )
85
85
. http_api ( )
86
+ . http_index ( )
87
+ . auth_required ( )
86
88
. build ( ) ;
87
89
88
90
let provider = build_provider (
89
91
"test-cred" ,
90
- r#"{"Ok":{"kind":"get","token":"sekrit","cache":"session","operation_independent":true }}"# ,
92
+ r#"{"Ok":{"kind":"get","token":"sekrit","cache":"session","operation_independent":false }}"# ,
91
93
) ;
92
94
93
95
let p = project ( )
@@ -123,13 +125,14 @@ fn publish() {
123
125
// Checks that credential-process is used for `cargo publish`.
124
126
let ( p, _t) = get_token_test ( ) ;
125
127
126
- p. cargo ( "publish --no-verify --registry alternative -Z credential-process" )
128
+ p. cargo ( "publish --no-verify --registry alternative -Z credential-process -Z registry-auth " )
127
129
. masquerade_as_nightly_cargo ( & [ "credential-process" ] )
128
130
. with_stderr (
129
131
r#"[UPDATING] [..]
130
- {"v":1,"registry":{"index-url":"[..]","name":"alternative","www-authenticate":null },"kind":"get","operation":"read","args":[]}
132
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..] },"kind":"get","operation":"read","args":[]}
131
133
[PACKAGING] foo v0.1.0 [..]
132
134
[PACKAGED] [..]
135
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]","args":[]}
133
136
[UPLOADING] foo v0.1.0 [..]
134
137
[UPLOADED] foo v0.1.0 [..]
135
138
note: Waiting [..]
@@ -190,7 +193,7 @@ fn login() {
190
193
. replace_crates_io ( registry. index_url ( ) )
191
194
. with_stderr (
192
195
r#"[UPDATING] [..]
193
- {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io","www-authenticate":null },"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
196
+ {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
194
197
"# ,
195
198
)
196
199
. run ( ) ;
@@ -210,7 +213,7 @@ fn logout() {
210
213
. masquerade_as_nightly_cargo ( & [ "credential-process" ] )
211
214
. replace_crates_io ( server. index_url ( ) )
212
215
. with_stderr (
213
- r#"{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io","www-authenticate":null },"kind":"logout","args":[]}
216
+ r#"{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"logout","args":[]}
214
217
"# ,
215
218
)
216
219
. run ( ) ;
@@ -220,11 +223,12 @@ fn logout() {
220
223
fn yank ( ) {
221
224
let ( p, _t) = get_token_test ( ) ;
222
225
223
- p. cargo ( "yank --version 0.1.0 --registry alternative -Z credential -process" )
226
+ p. cargo ( "yank --version 0.1.0 --registry alternative -Zcredential -process -Zregistry-auth " )
224
227
. masquerade_as_nightly_cargo ( & [ "credential-process" ] )
225
228
. with_stderr (
226
229
r#"[UPDATING] [..]
227
- {"v":1,"registry":{"index-url":"[..]","name":"alternative","www-authenticate":null},"kind":"get","operation":"yank","name":"foo","vers":"0.1.0","args":[]}
230
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..]},"kind":"get","operation":"read","args":[]}
231
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"yank","name":"foo","vers":"0.1.0","args":[]}
228
232
229
233
"# ,
230
234
)
@@ -235,11 +239,12 @@ fn yank() {
235
239
fn owner ( ) {
236
240
let ( p, _t) = get_token_test ( ) ;
237
241
238
- p. cargo ( "owner --add username --registry alternative -Z credential -process" )
242
+ p. cargo ( "owner --add username --registry alternative -Zcredential -process -Zregistry-auth " )
239
243
. masquerade_as_nightly_cargo ( & [ "credential-process" ] )
240
244
. with_stderr (
241
245
r#"[UPDATING] [..]
242
- {"v":1,"registry":{"index-url":"[..]","name":"alternative","www-authenticate":null},"kind":"get","operation":"owners","name":"foo","args":[]}
246
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..]},"kind":"get","operation":"read","args":[]}
247
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"owners","name":"foo","args":[]}
243
248
[OWNER] completed!
244
249
"# ,
245
250
)
@@ -345,9 +350,9 @@ fn multiple_providers() {
345
350
. with_stderr (
346
351
r#"[UPDATING] [..]
347
352
[CREDENTIAL] [..]url_not_supported[..] login crates-io
348
- {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io","www-authenticate":null },"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
353
+ {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
349
354
[CREDENTIAL] [..]success_provider[..] login crates-io
350
- {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io","www-authenticate":null },"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
355
+ {"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":[]}
351
356
"# ,
352
357
)
353
358
. run ( ) ;
@@ -423,6 +428,7 @@ fn token_caching() {
423
428
) )
424
429
. alternative ( )
425
430
. http_api ( )
431
+ . http_index ( )
426
432
. build ( ) ;
427
433
428
434
// Token should not be re-used if it is expired
@@ -464,10 +470,10 @@ fn token_caching() {
464
470
. build ( ) ;
465
471
466
472
let output = r#"[UPDATING] `alternative` index
467
- {"v":1,"registry":{"index-url":"[..]","name":"alternative","www-authenticate":null },"kind":"get","operation":"read","args":[]}
473
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"read","args":[]}
468
474
[PACKAGING] foo v0.1.0 [..]
469
475
[PACKAGED] [..]
470
- {"v":1,"registry":{"index-url":"[..]","name":"alternative","www-authenticate":null },"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]","args":[]}
476
+ {"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]","args":[]}
471
477
[UPLOADING] foo v0.1.0 [..]
472
478
[UPLOADED] foo v0.1.0 [..]
473
479
note: Waiting [..]
0 commit comments