Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
ngx_http_voms_module
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cnafsd
ngx_http_voms_module
Commits
2db6cbba
Commit
2db6cbba
authored
7 years ago
by
Francesco Giacomini
Browse files
Options
Downloads
Patches
Plain Diff
wip: generic attributes
parent
b51cdeb2
No related branches found
No related tags found
1 merge request
!3
Add VOMS embedded variables
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ngx_http_voms_module.cpp
+22
-4
22 additions, 4 deletions
src/ngx_http_voms_module.cpp
with
22 additions
and
4 deletions
src/ngx_http_voms_module.cpp
+
22
−
4
View file @
2db6cbba
...
...
@@ -191,7 +191,7 @@ static ngx_int_t add_variables(ngx_conf_t* cf)
// return the first AC, if present
static
MaybeVomsAc
retrieve_voms_ac_from_proxy
(
ngx_http_request_t
*
r
)
{
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
FUNCTION
__
);
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
func
__
);
if
(
!
r
->
http_connection
->
ssl
)
{
return
boost
::
none
;
...
...
@@ -241,7 +241,7 @@ static MaybeVomsAc retrieve_voms_ac_from_proxy(ngx_http_request_t* r)
static
void
clean_voms_ac
(
void
*
data
)
{
auto
r
=
static_cast
<
ngx_http_request_t
*>
(
data
);
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
FUNCTION
__
);
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
func
__
);
auto
p
=
static_cast
<
MaybeVomsAc
*>
(
ngx_http_get_module_ctx
(
r
,
ngx_http_voms_module
));
...
...
@@ -269,7 +269,7 @@ static MaybeVomsAc* get_voms_ac_from_cache(ngx_http_request_t* r)
static
MaybeVomsAc
const
&
get_voms_ac
(
ngx_http_request_t
*
r
)
{
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
FUNCTION
__
);
ngx_log_error
(
NGX_LOG_DEBUG
,
r
->
connection
->
log
,
0
,
"%s"
,
__
func
__
);
MaybeVomsAc
*
acp
=
get_voms_ac_from_cache
(
r
);
...
...
@@ -372,11 +372,29 @@ std::string get_voms_not_after(VomsAc const& ac)
// std::vector<attribute> attributes; /*!< The attributes themselves. */
// };
static
std
::
string
encode
(
attribute
const
&
a
)
{
return
"n"
+
a
.
name
+
" v="
+
a
.
value
+
" q="
+
a
.
qualifier
;
}
std
::
string
get_voms_generic_attributes
(
VomsAc
const
&
ac
)
{
std
::
string
result
;
// the GetAttributes method is not declared const
auto
const
attributes
=
const_cast
<
VomsAc
&>
(
ac
).
GetAttributes
();
return
{};
if
(
!
attributes
.
empty
())
{
auto
&
gas
=
attributes
.
front
().
attributes
;
bool
first
=
true
;
for
(
auto
&
a
:
gas
)
{
result
+=
encode
(
a
);
if
(
!
first
)
{
result
+=
','
;
}
}
}
return
result
;
}
std
::
string
get_voms_serial
(
VomsAc
const
&
ac
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment