]> git.ipfire.org Git - thirdparty/git.git/commitdiff
credential: enable state capability
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 17 Apr 2024 00:02:34 +0000 (00:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Apr 2024 05:39:07 +0000 (22:39 -0700)
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>
credential.c
t/t5563-simple-http-auth.sh

index 48826fb5a2593b9a9e133ab534100baea19d33b2..c93de92f65c734a0b1a121326abbb887c9fa70b7 100644 (file)
@@ -56,6 +56,7 @@ void credential_set_all_capabilities(struct credential *c,
                                     enum credential_op_type op_type)
 {
        credential_set_capability(&c->capa_authtype, op_type);
+       credential_set_capability(&c->capa_state, op_type);
 }
 
 int credential_match(const struct credential *want,
index b3ed0d9fc20736a1e49d3834d138c4373e2c125a..b098cd0fdf489c72aafe7061945e9ed8f7ccc899 100755 (executable)
@@ -75,6 +75,7 @@ test_expect_success 'access using basic auth' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=Basic realm="example.com"
@@ -111,6 +112,7 @@ test_expect_success 'access using basic auth via authtype' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=Basic realm="example.com"
@@ -147,6 +149,7 @@ test_expect_success 'access using basic auth invalid credentials' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=Basic realm="example.com"
@@ -185,6 +188,7 @@ test_expect_success 'access using basic auth with extra challenges' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"
@@ -224,6 +228,7 @@ test_expect_success 'access using basic auth mixed-case wwwauth header name' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=foobar param1="value1" param2="value2"
@@ -268,6 +273,7 @@ test_expect_success 'access using basic auth with wwwauth header continuations'
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"
@@ -314,6 +320,7 @@ test_expect_success 'access using basic auth with wwwauth header empty continuat
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"
@@ -356,6 +363,7 @@ test_expect_success 'access using basic auth with wwwauth header mixed line-endi
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"
@@ -397,6 +405,7 @@ test_expect_success 'access using bearer auth' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"
@@ -440,6 +449,7 @@ test_expect_success 'access using bearer auth with invalid credentials' '
 
        expect_credential_query get <<-EOF &&
        capability[]=authtype
+       capability[]=state
        protocol=http
        host=$HTTPD_DEST
        wwwauth[]=FooBar param1="value1" param2="value2"