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
1 merge request!3Add VOMS embedded variables
...@@ -374,7 +374,7 @@ std::string get_voms_not_after(VomsAc const& ac) ...@@ -374,7 +374,7 @@ std::string get_voms_not_after(VomsAc const& ac)
static std::string encode(attribute const& a) 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) std::string get_voms_generic_attributes(VomsAc const& ac)
...@@ -387,10 +387,12 @@ 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; auto& gas = attributes.front().attributes;
bool first = true; bool first = true;
for (auto& a : gas) { for (auto& a : gas) {
result += encode(a); if (first) {
if (!first) { first = false;
} else {
result += ','; result += ',';
} }
result += encode(a);
} }
} }
......
...@@ -5,7 +5,7 @@ run_tests(); ...@@ -5,7 +5,7 @@ run_tests();
__DATA__ __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 --- main_config
env OPENSSL_ALLOW_PROXY_CERTS=1; env OPENSSL_ALLOW_PROXY_CERTS=1;
env X509_VOMS_DIR=t/vomsdir; env X509_VOMS_DIR=t/vomsdir;
...@@ -46,11 +46,12 @@ GET / ...@@ -46,11 +46,12 @@ GET /
/C=IT/O=IGI/CN=test0 /C=IT/O=IGI/CN=test0
/C=IT/O=IGI/CN=Test CA /C=IT/O=IGI/CN=Test CA
/test/exp1,/test/exp2,/test/exp3/Role=PIPPO /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 /C=IT/O=IGI/CN=Test CA
test.vo test.vo
2018-01-01T00:00:00 voms.example:15000
2030-01-01T00:00:00 20180101000000Z
nickname = newland (test.vo),nickname = giaco (test.vo) 20300101000000Z
1644758975 n=nickname v=newland q=test.vo,n=nickname v=giaco q=test.vo
0
--- error_code: 200 --- 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