Skip to content

Commit 36f7d86

Browse files
bk2204gitster
authored andcommitted
credential: enable state capability
Now that we've implemented the state capability, let's send it along by default when filling credentials so we can make use of it. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8470c94 commit 36f7d86

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

credential.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void credential_set_all_capabilities(struct credential *c,
5656
enum credential_op_type op_type)
5757
{
5858
credential_set_capability(&c->capa_authtype, op_type);
59+
credential_set_capability(&c->capa_state, op_type);
5960
}
6061

6162
int credential_match(const struct credential *want,

t/t5563-simple-http-auth.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ test_expect_success 'access using basic auth' '
7575
7676
expect_credential_query get <<-EOF &&
7777
capability[]=authtype
78+
capability[]=state
7879
protocol=http
7980
host=$HTTPD_DEST
8081
wwwauth[]=Basic realm="example.com"
@@ -111,6 +112,7 @@ test_expect_success 'access using basic auth via authtype' '
111112
112113
expect_credential_query get <<-EOF &&
113114
capability[]=authtype
115+
capability[]=state
114116
protocol=http
115117
host=$HTTPD_DEST
116118
wwwauth[]=Basic realm="example.com"
@@ -147,6 +149,7 @@ test_expect_success 'access using basic auth invalid credentials' '
147149
148150
expect_credential_query get <<-EOF &&
149151
capability[]=authtype
152+
capability[]=state
150153
protocol=http
151154
host=$HTTPD_DEST
152155
wwwauth[]=Basic realm="example.com"
@@ -185,6 +188,7 @@ test_expect_success 'access using basic auth with extra challenges' '
185188
186189
expect_credential_query get <<-EOF &&
187190
capability[]=authtype
191+
capability[]=state
188192
protocol=http
189193
host=$HTTPD_DEST
190194
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -224,6 +228,7 @@ test_expect_success 'access using basic auth mixed-case wwwauth header name' '
224228
225229
expect_credential_query get <<-EOF &&
226230
capability[]=authtype
231+
capability[]=state
227232
protocol=http
228233
host=$HTTPD_DEST
229234
wwwauth[]=foobar param1="value1" param2="value2"
@@ -268,6 +273,7 @@ test_expect_success 'access using basic auth with wwwauth header continuations'
268273
269274
expect_credential_query get <<-EOF &&
270275
capability[]=authtype
276+
capability[]=state
271277
protocol=http
272278
host=$HTTPD_DEST
273279
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -314,6 +320,7 @@ test_expect_success 'access using basic auth with wwwauth header empty continuat
314320
315321
expect_credential_query get <<-EOF &&
316322
capability[]=authtype
323+
capability[]=state
317324
protocol=http
318325
host=$HTTPD_DEST
319326
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -356,6 +363,7 @@ test_expect_success 'access using basic auth with wwwauth header mixed line-endi
356363
357364
expect_credential_query get <<-EOF &&
358365
capability[]=authtype
366+
capability[]=state
359367
protocol=http
360368
host=$HTTPD_DEST
361369
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -397,6 +405,7 @@ test_expect_success 'access using bearer auth' '
397405
398406
expect_credential_query get <<-EOF &&
399407
capability[]=authtype
408+
capability[]=state
400409
protocol=http
401410
host=$HTTPD_DEST
402411
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -440,6 +449,7 @@ test_expect_success 'access using bearer auth with invalid credentials' '
440449
441450
expect_credential_query get <<-EOF &&
442451
capability[]=authtype
452+
capability[]=state
443453
protocol=http
444454
host=$HTTPD_DEST
445455
wwwauth[]=FooBar param1="value1" param2="value2"

0 commit comments

Comments
 (0)