Skip to content

Commit 153d879

Browse files
committed
add DiscoveryResponse info to SPs in discojson
1 parent 808c283 commit 153d879

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,6 @@ to sign using HSMs. The only mandatory non-python dependency now is lxml.
171171
* Fix random seeding
172172
* Fix for data handling related to non-Z timezones in metadata
173173

174+
2.1.3
175+
-----
176+
* Add DiscoveryResponse info to SPs in discojson

src/pyff/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
ser="http://eidas.europa.eu/metadata/servicelist",
3838
eidas="http://eidas.europa.eu/saml-extensions",
3939
ti="https://seamlessaccess.org/NS/trustinfo",
40+
idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol",
4041
)
4142

4243
#: These are the attribute aliases pyFF knows about. These are used to build URI paths, populate the index

src/pyff/samlmd.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,14 @@ def registration_authority(entity):
783783
return regauth_el.attrib.get('registrationAuthority')
784784

785785

786+
def discovery_responses(entity):
787+
responses = None
788+
responses_els = entity.findall(".//{%s}DiscoveryResponse" % NS['idpdisc'])
789+
if len(responses_els) > 0:
790+
responses = [el.attrib.get('Location') for el in responses_els]
791+
return responses
792+
793+
786794
def entity_extended_display(entity, langs=None):
787795
"""Utility-method for computing a displayable string for a given entity.
788796
@@ -875,6 +883,7 @@ def discojson(e, sources=None, langs=None, fallback_to_favicon=False, icon_store
875883
categories = entity_attribute(e, "http://macedir.org/entity-category")
876884
certifications = entity_attribute(e, "urn:oasis:names:tc:SAML:attribute:assurance-certification")
877885
cat_support = entity_attribute(e, "http://macedir.org/entity-category-support")
886+
disc_responses = discovery_responses(e)
878887

879888
d = dict(
880889
title=title,
@@ -900,6 +909,9 @@ def discojson(e, sources=None, langs=None, fallback_to_favicon=False, icon_store
900909
if sources is not None:
901910
d['md_source'] = sources
902911

912+
if disc_responses is not None:
913+
d["discovery_responses"] = disc_responses
914+
903915
eattr = entity_attribute_dict(e)
904916
if 'idp' in eattr[ATTRS['role']]:
905917
d['type'] = 'idp'

0 commit comments

Comments
 (0)