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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Apr 17, 2024 at 00:02 UTC
36f7d865e340c3afe578df05c6d9e8f9a7bda887
2 files changed
+11
credential.c
+1
@@ -56,6 +56,7 @@ void credential_set_all_capabilities(struct credential *c,
56
enum credential_op_type op_type)
57
{
58
credential_set_capability(&c->capa_authtype, op_type);
59
+ credential_set_capability(&c->capa_state, op_type);
60
}
61
62
int credential_match(const struct credential *want,
t/t5563-simple-http-auth.sh
+10
@@ -75,6 +75,7 @@ test_expect_success 'access using basic auth' '
75
76
expect_credential_query get <<-EOF &&
77
capability[]=authtype
78
+ capability[]=state
79
protocol=http
80
host=$HTTPD_DEST
81
wwwauth[]=Basic realm="example.com"
@@ -111,6 +112,7 @@ test_expect_success 'access using basic auth via authtype' '
112
113
expect_credential_query get <<-EOF &&
114
capability[]=authtype
115
+ capability[]=state
116
protocol=http
117
host=$HTTPD_DEST
118
wwwauth[]=Basic realm="example.com"
@@ -147,6 +149,7 @@ test_expect_success 'access using basic auth invalid credentials' '
149
150
expect_credential_query get <<-EOF &&
151
capability[]=authtype
152
+ capability[]=state
153
protocol=http
154
host=$HTTPD_DEST
155
wwwauth[]=Basic realm="example.com"
@@ -185,6 +188,7 @@ test_expect_success 'access using basic auth with extra challenges' '
188
189
expect_credential_query get <<-EOF &&
190
capability[]=authtype
191
+ capability[]=state
192
protocol=http
193
host=$HTTPD_DEST
194
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -224,6 +228,7 @@ test_expect_success 'access using basic auth mixed-case wwwauth header name' '
228
229
expect_credential_query get <<-EOF &&
230
capability[]=authtype
231
+ capability[]=state
232
protocol=http
233
host=$HTTPD_DEST
234
wwwauth[]=foobar param1="value1" param2="value2"
@@ -268,6 +273,7 @@ test_expect_success 'access using basic auth with wwwauth header continuations'
273
274
expect_credential_query get <<-EOF &&
275
capability[]=authtype
276
+ capability[]=state
277
protocol=http
278
host=$HTTPD_DEST
279
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -314,6 +320,7 @@ test_expect_success 'access using basic auth with wwwauth header empty continuat
320
321
expect_credential_query get <<-EOF &&
322
capability[]=authtype
323
+ capability[]=state
324
protocol=http
325
host=$HTTPD_DEST
326
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -356,6 +363,7 @@ test_expect_success 'access using basic auth with wwwauth header mixed line-endi
363
364
expect_credential_query get <<-EOF &&
365
capability[]=authtype
366
+ capability[]=state
367
protocol=http
368
host=$HTTPD_DEST
369
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -397,6 +405,7 @@ test_expect_success 'access using bearer auth' '
405
406
expect_credential_query get <<-EOF &&
407
capability[]=authtype
408
+ capability[]=state
409
protocol=http
410
host=$HTTPD_DEST
411
wwwauth[]=FooBar param1="value1" param2="value2"
@@ -440,6 +449,7 @@ test_expect_success 'access using bearer auth with invalid credentials' '
449
450
expect_credential_query get <<-EOF &&
451
capability[]=authtype
452
+ capability[]=state
453
protocol=http
454
host=$HTTPD_DEST
455
wwwauth[]=FooBar param1="value1" param2="value2"