@@ -63,11 +63,12 @@ test_expect_success 'access using basic auth' '
63
63
64
64
# Basic base64(alice:secret-passwd)
65
65
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
66
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
66
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
67
67
EOF
68
68
69
69
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
70
- WWW-Authenticate: Basic realm="example.com"
70
+ id=1 status=200
71
+ id=default response=WWW-Authenticate: Basic realm="example.com"
71
72
EOF
72
73
73
74
test_config_global credential.helper test-helper &&
@@ -100,11 +101,12 @@ test_expect_success 'access using basic auth via authtype' '
100
101
101
102
# Basic base64(alice:secret-passwd)
102
103
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
103
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
104
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
104
105
EOF
105
106
106
107
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
107
- WWW-Authenticate: Basic realm="example.com"
108
+ id=1 status=200
109
+ id=default response=WWW-Authenticate: Basic realm="example.com"
108
110
EOF
109
111
110
112
test_config_global credential.helper test-helper &&
@@ -137,11 +139,12 @@ test_expect_success 'access using basic auth invalid credentials' '
137
139
138
140
# Basic base64(alice:secret-passwd)
139
141
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
140
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
142
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
141
143
EOF
142
144
143
145
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
144
- WWW-Authenticate: Basic realm="example.com"
146
+ id=1 status=200
147
+ id=default response=WWW-Authenticate: Basic realm="example.com"
145
148
EOF
146
149
147
150
test_config_global credential.helper test-helper &&
@@ -174,13 +177,14 @@ test_expect_success 'access using basic auth with extra challenges' '
174
177
175
178
# Basic base64(alice:secret-passwd)
176
179
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
177
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
180
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
178
181
EOF
179
182
180
183
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
181
- WWW-Authenticate: FooBar param1="value1" param2="value2"
182
- WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
183
- WWW-Authenticate: Basic realm="example.com"
184
+ id=1 status=200
185
+ id=default response=WWW-Authenticate: FooBar param1="value1" param2="value2"
186
+ id=default response=WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
187
+ id=default response=WWW-Authenticate: Basic realm="example.com"
184
188
EOF
185
189
186
190
test_config_global credential.helper test-helper &&
@@ -214,13 +218,14 @@ test_expect_success 'access using basic auth mixed-case wwwauth header name' '
214
218
215
219
# Basic base64(alice:secret-passwd)
216
220
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
217
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
221
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
218
222
EOF
219
223
220
224
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
221
- www-authenticate: foobar param1="value1" param2="value2"
222
- WWW-AUTHENTICATE: BEARER authorize_uri="id.example.com" p=1 q=0
223
- WwW-aUtHeNtIcAtE: baSiC realm="example.com"
225
+ id=1 status=200
226
+ id=default response=www-authenticate: foobar param1="value1" param2="value2"
227
+ id=default response=WWW-AUTHENTICATE: BEARER authorize_uri="id.example.com" p=1 q=0
228
+ id=default response=WwW-aUtHeNtIcAtE: baSiC realm="example.com"
224
229
EOF
225
230
226
231
test_config_global credential.helper test-helper &&
@@ -254,18 +259,19 @@ test_expect_success 'access using basic auth with wwwauth header continuations'
254
259
255
260
# Basic base64(alice:secret-passwd)
256
261
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
257
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
262
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
258
263
EOF
259
264
260
265
# Note that leading and trailing whitespace is important to correctly
261
266
# simulate a continuation/folded header.
262
267
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
263
- WWW-Authenticate: FooBar param1="value1"
264
- param2="value2"
265
- WWW-Authenticate: Bearer authorize_uri="id.example.com"
266
- p=1
267
- q=0
268
- WWW-Authenticate: Basic realm="example.com"
268
+ id=1 status=200
269
+ id=default response=WWW-Authenticate: FooBar param1="value1"
270
+ id=default response= param2="value2"
271
+ id=default response=WWW-Authenticate: Bearer authorize_uri="id.example.com"
272
+ id=default response= p=1
273
+ id=default response= q=0
274
+ id=default response=WWW-Authenticate: Basic realm="example.com"
269
275
EOF
270
276
271
277
test_config_global credential.helper test-helper &&
@@ -299,21 +305,22 @@ test_expect_success 'access using basic auth with wwwauth header empty continuat
299
305
300
306
# Basic base64(alice:secret-passwd)
301
307
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
302
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
308
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
303
309
EOF
304
310
305
311
CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
306
312
307
313
# Note that leading and trailing whitespace is important to correctly
308
314
# simulate a continuation/folded header.
309
- printf "WWW-Authenticate: FooBar param1=\"value1\"\r\n" >"$CHALLENGE" &&
310
- printf " \r\n" >>"$CHALLENGE" &&
311
- printf " param2=\"value2\"\r\n" >>"$CHALLENGE" &&
312
- printf "WWW-Authenticate: Bearer authorize_uri=\"id.example.com\"\r\n" >>"$CHALLENGE" &&
313
- printf " p=1\r\n" >>"$CHALLENGE" &&
314
- printf " \r\n" >>"$CHALLENGE" &&
315
- printf " q=0\r\n" >>"$CHALLENGE" &&
316
- printf "WWW-Authenticate: Basic realm=\"example.com\"\r\n" >>"$CHALLENGE" &&
315
+ printf "id=1 status=200\n" >"$CHALLENGE" &&
316
+ printf "id=default response=WWW-Authenticate: FooBar param1=\"value1\"\r\n" >>"$CHALLENGE" &&
317
+ printf "id=default response= \r\n" >>"$CHALLENGE" &&
318
+ printf "id=default response= param2=\"value2\"\r\n" >>"$CHALLENGE" &&
319
+ printf "id=default response=WWW-Authenticate: Bearer authorize_uri=\"id.example.com\"\r\n" >>"$CHALLENGE" &&
320
+ printf "id=default response= p=1\r\n" >>"$CHALLENGE" &&
321
+ printf "id=default response= \r\n" >>"$CHALLENGE" &&
322
+ printf "id=default response= q=0\r\n" >>"$CHALLENGE" &&
323
+ printf "id=default response=WWW-Authenticate: Basic realm=\"example.com\"\r\n" >>"$CHALLENGE" &&
317
324
318
325
test_config_global credential.helper test-helper &&
319
326
git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
@@ -346,17 +353,18 @@ test_expect_success 'access using basic auth with wwwauth header mixed line-endi
346
353
347
354
# Basic base64(alice:secret-passwd)
348
355
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
349
- Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
356
+ id=1 creds= Basic YWxpY2U6c2VjcmV0LXBhc3N3ZA==
350
357
EOF
351
358
352
359
CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
353
360
354
361
# Note that leading and trailing whitespace is important to correctly
355
362
# simulate a continuation/folded header.
356
- printf "WWW-Authenticate: FooBar param1=\"value1\"\r\n" >"$CHALLENGE" &&
357
- printf " \r\n" >>"$CHALLENGE" &&
358
- printf "\tparam2=\"value2\"\r\n" >>"$CHALLENGE" &&
359
- printf "WWW-Authenticate: Basic realm=\"example.com\"" >>"$CHALLENGE" &&
363
+ printf "id=1 status=200\n" >"$CHALLENGE" &&
364
+ printf "id=default response=WWW-Authenticate: FooBar param1=\"value1\"\r\n" >>"$CHALLENGE" &&
365
+ printf "id=default response= \r\n" >>"$CHALLENGE" &&
366
+ printf "id=default response=\tparam2=\"value2\"\r\n" >>"$CHALLENGE" &&
367
+ printf "id=default response=WWW-Authenticate: Basic realm=\"example.com\"" >>"$CHALLENGE" &&
360
368
361
369
test_config_global credential.helper test-helper &&
362
370
git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&
@@ -389,15 +397,16 @@ test_expect_success 'access using bearer auth' '
389
397
390
398
# Basic base64(a-git-token)
391
399
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
392
- Bearer YS1naXQtdG9rZW4=
400
+ id=1 creds= Bearer YS1naXQtdG9rZW4=
393
401
EOF
394
402
395
403
CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
396
404
397
405
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
398
- WWW-Authenticate: FooBar param1="value1" param2="value2"
399
- WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
400
- WWW-Authenticate: Basic realm="example.com"
406
+ id=1 status=200
407
+ id=default response=WWW-Authenticate: FooBar param1="value1" param2="value2"
408
+ id=default response=WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
409
+ id=default response=WWW-Authenticate: Basic realm="example.com"
401
410
EOF
402
411
403
412
test_config_global credential.helper test-helper &&
@@ -433,15 +442,16 @@ test_expect_success 'access using bearer auth with invalid credentials' '
433
442
434
443
# Basic base64(a-git-token)
435
444
cat >"$HTTPD_ROOT_PATH/custom-auth.valid" <<-EOF &&
436
- Bearer YS1naXQtdG9rZW4=
445
+ id=1 creds= Bearer YS1naXQtdG9rZW4=
437
446
EOF
438
447
439
448
CHALLENGE="$HTTPD_ROOT_PATH/custom-auth.challenge" &&
440
449
441
450
cat >"$HTTPD_ROOT_PATH/custom-auth.challenge" <<-EOF &&
442
- WWW-Authenticate: FooBar param1="value1" param2="value2"
443
- WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
444
- WWW-Authenticate: Basic realm="example.com"
451
+ id=1 status=200
452
+ id=default response=WWW-Authenticate: FooBar param1="value1" param2="value2"
453
+ id=default response=WWW-Authenticate: Bearer authorize_uri="id.example.com" p=1 q=0
454
+ id=default response=WWW-Authenticate: Basic realm="example.com"
445
455
EOF
446
456
447
457
test_config_global credential.helper test-helper &&
0 commit comments