Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
djnro
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
djnro
Commits
e0adfeb0
Commit
e0adfeb0
authored
Dec 02, 2015
by
Zenon Mousmoulas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust servdata consumer templates so they can handle the "server re-use across
institutions" use case.
parent
95bb2910
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
extras/freeradius-clients.tpl
extras/freeradius-clients.tpl
+7
-0
extras/freeradius-proxy.tpl
extras/freeradius-proxy.tpl
+7
-0
extras/radsecproxy.tpl
extras/radsecproxy.tpl
+14
-0
No files found.
extras/freeradius-clients.tpl
View file @
e0adfeb0
...
@@ -6,6 +6,9 @@ import re
...
@@ -6,6 +6,9 @@ import re
% if inst['type'] in (2, 3) and 'clients' in inst:
% if inst['type'] in (2, 3) and 'clients' in inst:
#{{
{
$
{
' '
+
inst
[
'id'
]
if
'id'
in
inst
else
''
}
#{{
{
$
{
' '
+
inst
[
'id'
]
if
'id'
in
inst
else
''
}
%
for
client
in
inst
[
'clients'
]:
%
for
client
in
inst
[
'clients'
]:
%
if
'seen'
in
clients
[
client
]:
#
client
$
{
client
}
defined
previously
%
else
:
client
$
{
client
}
{
client
$
{
client
}
{
secret
=
$
{
clients
[
client
][
'secret'
]
}
secret
=
$
{
clients
[
client
][
'secret'
]
}
<%
<%
...
@@ -21,6 +24,10 @@ ipaddr = re.split(r'/(?=[0-9]{1,2}$)', clients[client]['host'])
...
@@ -21,6 +24,10 @@ ipaddr = re.split(r'/(?=[0-9]{1,2}$)', clients[client]['host'])
%
endif
%
endif
eduroamspco
=
GR
eduroamspco
=
GR
}
}
<
%
clients
[
client
]['
seen
'
] =
True
%
>
\
% endif
% endfor
% endfor
#}}}
#}}}
% endif
% endif
...
...
extras/freeradius-proxy.tpl
View file @
e0adfeb0
...
@@ -31,6 +31,9 @@ for r in inst['realms']:
...
@@ -31,6 +31,9 @@ for r in inst['realms']:
for
srv
in
inst_servers
:
for
srv
in
inst_servers
:
</%
doc
>
\
</%
doc
>
\
%
for
srv
in
set
([
s
for
r
in
inst
[
'realms'
]
for
s
in
inst
[
'realms'
][
r
][
'proxy_to'
]
if
'proxy_to'
in
inst
[
'realms'
][
r
]]):
%
for
srv
in
set
([
s
for
r
in
inst
[
'realms'
]
for
s
in
inst
[
'realms'
][
r
][
'proxy_to'
]
if
'proxy_to'
in
inst
[
'realms'
][
r
]]):
%
if
'seen'
in
servers
[
srv
]:
#
server
$
{
srv
}
defined
previously
%
else
:
home_server
$
{
srv
}
{
home_server
$
{
srv
}
{
type
=
$
{
servers
[
srv
][
'rad_pkt_type'
]
}
type
=
$
{
servers
[
srv
][
'rad_pkt_type'
]
}
ipaddr
=
$
{
servers
[
srv
][
'host'
]
}
ipaddr
=
$
{
servers
[
srv
][
'host'
]
}
...
@@ -47,6 +50,10 @@ home_server ${srv} {
...
@@ -47,6 +50,10 @@ home_server ${srv} {
check_interval
=
30
check_interval
=
30
num_answers_to_alive
=
3
num_answers_to_alive
=
3
}
}
<
%
servers
[
srv
]['
seen
'
] =
True
%
>
\
% endif
% endfor
% endfor
% for realm in sorted([r for r in inst['realms'] if 'proxy_to' in inst['realms'][r]], cmp=wildcard_realm_least_precedence, reverse=True):
% for realm in sorted([r for r in inst['realms'] if 'proxy_to' in inst['realms'][r]], cmp=wildcard_realm_least_precedence, reverse=True):
<
%
<
%
...
...
extras/radsecproxy.tpl
View file @
e0adfeb0
...
@@ -23,6 +23,9 @@ def wildcard_realm_least_precedence(a, b):
...
@@ -23,6 +23,9 @@ def wildcard_realm_least_precedence(a, b):
#{{
{
$
{
' '
+
inst
[
'id'
]
if
'id'
in
inst
else
''
}
#{{
{
$
{
' '
+
inst
[
'id'
]
if
'id'
in
inst
else
''
}
%
if
inst
[
'type'
]
in
(
2
,
3
)
and
'clients'
in
inst
:
%
if
inst
[
'type'
]
in
(
2
,
3
)
and
'clients'
in
inst
:
%
for
client
in
inst
[
'clients'
]:
%
for
client
in
inst
[
'clients'
]:
%
if
'seen'
in
clients
[
client
]:
#
client
$
{
client
}
defined
previously
%
else
:
rewrite
rewrite
-
$
{
client
}
-
sp
{
rewrite
rewrite
-
$
{
client
}
-
sp
{
include
/
etc
/
radsecproxy
.
conf
.
d
/
rewrite
-
default
-
sp
.
conf
include
/
etc
/
radsecproxy
.
conf
.
d
/
rewrite
-
default
-
sp
.
conf
%
if
'id'
in
inst
:
%
if
'id'
in
inst
:
...
@@ -40,6 +43,10 @@ client ${client} {
...
@@ -40,6 +43,10 @@ client ${client} {
% endif
% endif
rewriteIn rewrite-$
{
client
}
-sp
rewriteIn rewrite-$
{
client
}
-sp
}
}
% endif
<
%
clients
[
client
]['
seen
'
] =
True
%
>
\
% endfor
% endfor
% endif
% endif
% if inst['type'] in (1, 3) and 'realms' in inst:
% if inst['type'] in (1, 3) and 'realms' in inst:
...
@@ -53,6 +60,9 @@ for r in inst['realms']:
...
@@ -53,6 +60,9 @@ for r in inst['realms']:
for srv in inst_servers:
for srv in inst_servers:
</
%
doc>
\
</
%
doc>
\
% for srv in set([s for r in inst['realms'] for s in inst['realms'][r]['proxy_to'] if 'proxy_to' in inst['realms'][r]]):
% for srv in set([s for r in inst['realms'] for s in inst['realms'][r]['proxy_to'] if 'proxy_to' in inst['realms'][r]]):
% if 'seen' in servers[srv]:
# server $
{
srv
}
defined previously
% else:
rewrite rewrite-$
{
srv
}
-idp {
rewrite rewrite-$
{
srv
}
-idp {
include /etc/radsecproxy.conf.d/rewrite-default-idp.conf
include /etc/radsecproxy.conf.d/rewrite-default-idp.conf
}
}
...
@@ -80,6 +90,10 @@ server ${srv}-acct {
...
@@ -80,6 +90,10 @@ server ${srv}-acct {
rewriteIn rewrite-$
{
srv
}
-idp
rewriteIn rewrite-$
{
srv
}
-idp
}
}
% endif
% endif
<
%
servers
[
srv
]['
seen
'
] =
True
%
>
\
% endif
% endfor
% endfor
% for realm in sorted([r for r in inst['realms'] if 'proxy_to' in inst['realms'][r]], cmp=wildcard_realm_least_precedence, reverse=True):
% for realm in sorted([r for r in inst['realms'] if 'proxy_to' in inst['realms'][r]], cmp=wildcard_realm_least_precedence, reverse=True):
realm $
{
realm
|
realm_regex
}
{
realm $
{
realm
|
realm_regex
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment