Skip to content

Commit 652e49e

Browse files
author
Roland Hedberg
committed
Merge pull request #124 from rhoerbe/master
added AT government attribute map; + some cosmetics
2 parents 041aa27 + 456045d commit 652e49e

File tree

4 files changed

+55
-7
lines changed

4 files changed

+55
-7
lines changed

doc/examples/idp.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
An extremly simple example of a SAML2 identity provider.
44
========================================================
55

6+
There are 2 example IDPs in the project's example directory:
7+
* idp2 has a static definition of users:
8+
* user attributes are defined in idp_user.py
9+
* the password is defined in the PASSWD dict in idp.py
10+
* idp2_repoze is using repoze.who middleware to perform authentication and attribute retrieval
11+
12+
Configuration
13+
-------------
14+
Entity configuration is described in "Configuration of pysaml2 entities"
15+
Server parameters like host and port and various command line parameters are
16+
defined in the main part of idp.py
17+
618
Setup:
719
******
820

example/idp2/idp.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from mako.lookup import TemplateLookup
5050

5151
logger = logging.getLogger("saml2.idp")
52-
52+
logger.setLevel(logging.WARNING)
5353

5454
class Cache(object):
5555
def __init__(self):
@@ -73,11 +73,6 @@ def _expiration(timeout, tformat="%a, %d-%b-%Y %H:%M:%S GMT"):
7373
return time_util.in_a_while(minutes=timeout, format=tformat)
7474

7575

76-
def get_eptid(idp, req_info, session):
77-
return idp.eptid.get(idp.config.entityid,
78-
req_info.sender(), session["permanent_id"],
79-
session["authn_auth"])
80-
8176
# -----------------------------------------------------------------------------
8277

8378

src/saml2/attributemaps/saml_uri.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
EDUCOURSE_OID = 'urn:oid:1.3.6.1.4.1.5923.1.6.1.'
22
EDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.5923.1.1.1.'
3+
LDAPGVAT_OID = 'urn:oid:1.2.40.0.10.2.1.1.' # ldap.gv.at definitions as specified in http://www.ref.gv.at/AG-IZ-PVP2-Version-2-1-0-2.2754.0.html
4+
LDAPGVAT_UCL_DIR_PILOT = UCL_DIR_PILOT
5+
LDAPGVAT_X500ATTR_OID = X500ATTR_OID
36
NETSCAPE_LDAP = 'urn:oid:2.16.840.1.113730.3.1.'
47
NOREDUPERSON_OID = 'urn:oid:1.3.6.1.4.1.2428.90.1.'
58
PKCS_9 = 'urn:oid:1.2.840.113549.1.9.1.'
@@ -26,6 +29,25 @@
2629
EDUPERSON_OID+'9': 'eduPersonScopedAffiliation',
2730
EDUPERSON_OID+'10': 'eduPersonTargetedID',
2831
EDUPERSON_OID+'11': 'eduPersonAssurance',
32+
LDAPGVAT_OID+'1': 'PVP-GID',
33+
LDAPGVAT_OID+'149': 'PVP-BPK',
34+
LDAPGVAT_OID+'153': 'PVP-OU-OKZ',
35+
LDAPGVAT_OID+'261.10': 'PVP-VERSION',
36+
LDAPGVAT_OID+'261.20': 'PVP-PRINCIPAL-NAME',
37+
LDAPGVAT_OID+'261.24': 'PVP-PARTICIPANT-OKZ',
38+
LDAPGVAT_OID+'261.30': 'PVP-ROLES',
39+
LDAPGVAT_OID+'261.40': 'PVP-INVOICE-RECPT-ID',
40+
LDAPGVAT_OID+'261.50': 'PVP-COST-CENTER-ID',
41+
LDAPGVAT_OID+'261.60': 'PVP-CHARGE-CODE',
42+
LDAPGVAT_OID+'3': 'PVP-OU-GV-OU-ID',
43+
LDAPGVAT_OID+'33': 'PVP-FUNCTION',
44+
LDAPGVAT_OID+'55': 'PVP-BIRTHDATE',
45+
LDAPGVAT_OID+'71': 'PVP-PARTICIPANT-ID',
46+
LDAPGVAT_UCL_DIR_PILOT+'1': 'PVP-USERID',
47+
LDAPGVAT_UCL_DIR_PILOT+'3': 'PVP-MAIL',
48+
LDAPGVAT_X500ATTR_OID+'11': 'PVP-OU',
49+
LDAPGVAT_X500ATTR_OID+'20': 'PVP-TEL',
50+
LDAPGVAT_X500ATTR_OID+'42': 'PVP-GIVENNAME',
2951
NETSCAPE_LDAP+'1': 'carLicense',
3052
NETSCAPE_LDAP+'2': 'departmentNumber',
3153
NETSCAPE_LDAP+'3': 'employeeNumber',
@@ -197,6 +219,25 @@
197219
'presentationAddress': X500ATTR_OID+'29',
198220
'protocolInformation': X500ATTR_OID+'48',
199221
'pseudonym': X500ATTR_OID+'65',
222+
'PVP-USERID': LDAPGVAT_UCL_DIR_PILOT+'1',
223+
'PVP-MAIL': LDAPGVAT_UCL_DIR_PILOT+'3',
224+
'PVP-GID': LDAPGVAT_OID+'1',
225+
'PVP-BPK': LDAPGVAT_OID+'149',
226+
'PVP-OU-OKZ': LDAPGVAT_OID+'153',
227+
'PVP-VERSION': LDAPGVAT_OID+'261.10',
228+
'PVP-PRINCIPAL-NAME': LDAPGVAT_OID+'261.20',
229+
'PVP-PARTICIPANT-OKZ': LDAPGVAT_OID+'261.24',
230+
'PVP-ROLES': LDAPGVAT_OID+'261.30',
231+
'PVP-INVOICE-RECPT-ID': LDAPGVAT_OID+'261.40',
232+
'PVP-COST-CENTER-ID': LDAPGVAT_OID+'261.50',
233+
'PVP-CHARGE-CODE': LDAPGVAT_OID+'261.60',
234+
'PVP-OU-GV-OU-ID': LDAPGVAT_OID+'3',
235+
'PVP-FUNCTION': LDAPGVAT_OID+'33',
236+
'PVP-BIRTHDATE': LDAPGVAT_OID+'55',
237+
'PVP-PARTICIPANT-ID': LDAPGVAT_OID+'71',
238+
'PVP-OU': LDAPGVAT_X500ATTR_OID+'11',
239+
'PVP-TEL': LDAPGVAT_X500ATTR_OID+'20',
240+
'PVP-GIVENNAME': LDAPGVAT_X500ATTR_OID+'42',
200241
'registeredAddress': X500ATTR_OID+'26',
201242
'roleOccupant': X500ATTR_OID+'33',
202243
'schacCountryOfCitizenship': SCHAC+'5',

src/saml2/mdstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def parse(self, xmlstr):
197197
try:
198198
if not valid(self.entities_descr.valid_until):
199199
raise ToOld(
200-
"Metadata not valid anymore, it's after %s" % (
200+
"Metadata not valid anymore, it's only valid until %s" % (
201201
self.entities_descr.valid_until,))
202202
except AttributeError:
203203
pass

0 commit comments

Comments
 (0)