Skip to content

Support for specifying endpoints as lists (instead of Python tuples) and UIInfo in SPSSO desc. #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/saml2/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def do_uiinfo(_uiinfo):
except KeyError:
pass
else:
raise SAMLError("Configuration error: ui_info logo")
raise SAMLError("Configuration error: ui_info keywords")
inst.append(keyw)
elif isinstance(val, dict):
keyw = mdui.Keywords()
Expand All @@ -323,7 +323,7 @@ def do_uiinfo(_uiinfo):
pass
inst.append(keyw)
else:
raise SAMLError("Configuration Error: ui_info logo")
raise SAMLError("Configuration Error: ui_info keywords")
except KeyError:
pass

Expand Down Expand Up @@ -416,7 +416,7 @@ def do_endpoints(conf, endpoints):
if isinstance(args, basestring): # Assume it's the location
args = {"location": args,
"binding": DEFAULT_BINDING[endpoint]}
elif isinstance(args, tuple):
elif isinstance(args, tuple) or isinstance(args, list):
if len(args) == 2: # (location, binding)
args = {"location": args[0], "binding": args[1]}
elif len(args) == 3: # (location, binding, index)
Expand Down Expand Up @@ -530,6 +530,12 @@ def do_spsso_descriptor(conf, cert=None):
for val in vals:
spsso.extensions.add_extension_element(val)

ui_info = conf.getattr("ui_info", "sp")
if ui_info:
if spsso.extensions is None:
spsso.extensions = md.Extensions()
spsso.extensions.add_extension_element(do_uiinfo(ui_info))

if cert:
encryption_type = conf.encryption_type
spsso.key_descriptor = do_key_descriptor(cert, encryption_type)
Expand Down