Skip to content
Snippets Groups Projects
Commit fdf6861d authored by Francesco Giacomini's avatar Francesco Giacomini
Browse files

[wip] generic attributes: fix test and code

parent 191e989a
No related branches found
No related tags found
No related merge requests found
......@@ -374,7 +374,7 @@ std::string get_voms_not_after(VomsAc const& ac)
static std::string encode(attribute const& a)
{
return "n" + a.name + " v=" + a.value + " q=" + a.qualifier;
return "n=" + a.name + " v=" + a.value + " q=" + a.qualifier;
}
std::string get_voms_generic_attributes(VomsAc const& ac)
......@@ -387,10 +387,12 @@ std::string get_voms_generic_attributes(VomsAc const& ac)
auto& gas = attributes.front().attributes;
bool first = true;
for (auto& a : gas) {
result += encode(a);
if (!first) {
if (first) {
first = false;
} else {
result += ',';
}
result += encode(a);
}
}
......
......@@ -5,7 +5,7 @@ run_tests();
__DATA__
=== TEST 1: https with x509 client authentication, verification of valid VOMS attributes extracted by ngx_http_voms_module
=== TEST 1: valid AC, including generic attributes
--- main_config
env OPENSSL_ALLOW_PROXY_CERTS=1;
env X509_VOMS_DIR=t/vomsdir;
......@@ -46,11 +46,12 @@ GET /
/C=IT/O=IGI/CN=test0
/C=IT/O=IGI/CN=Test CA
/test/exp1,/test/exp2,/test/exp3/Role=PIPPO
/C=IT/O=IGI/CN=nginx-voms.example
/C=IT/O=IGI/CN=voms.example
/C=IT/O=IGI/CN=Test CA
test.vo
2018-01-01T00:00:00
2030-01-01T00:00:00
nickname = newland (test.vo),nickname = giaco (test.vo)
1644758975
voms.example:15000
20180101000000Z
20300101000000Z
n=nickname v=newland q=test.vo,n=nickname v=giaco q=test.vo
0
--- error_code: 200
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment