Added support for endpoints as lists (read directly from JSON arrays instead of Python tuples) and UIInfo in SPSSO descriptor.
Also some cleanup of error message.
This commit is contained in:
@@ -312,7 +312,7 @@ def do_uiinfo(_uiinfo):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise SAMLError("Configuration error: ui_info logo")
|
raise SAMLError("Configuration error: ui_info keywords")
|
||||||
inst.append(keyw)
|
inst.append(keyw)
|
||||||
elif isinstance(val, dict):
|
elif isinstance(val, dict):
|
||||||
keyw = mdui.Keywords()
|
keyw = mdui.Keywords()
|
||||||
@@ -323,7 +323,7 @@ def do_uiinfo(_uiinfo):
|
|||||||
pass
|
pass
|
||||||
inst.append(keyw)
|
inst.append(keyw)
|
||||||
else:
|
else:
|
||||||
raise SAMLError("Configuration Error: ui_info logo")
|
raise SAMLError("Configuration Error: ui_info keywords")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -416,7 +416,7 @@ def do_endpoints(conf, endpoints):
|
|||||||
if isinstance(args, basestring): # Assume it's the location
|
if isinstance(args, basestring): # Assume it's the location
|
||||||
args = {"location": args,
|
args = {"location": args,
|
||||||
"binding": DEFAULT_BINDING[endpoint]}
|
"binding": DEFAULT_BINDING[endpoint]}
|
||||||
elif isinstance(args, tuple):
|
elif isinstance(args, tuple) or isinstance(args, list):
|
||||||
if len(args) == 2: # (location, binding)
|
if len(args) == 2: # (location, binding)
|
||||||
args = {"location": args[0], "binding": args[1]}
|
args = {"location": args[0], "binding": args[1]}
|
||||||
elif len(args) == 3: # (location, binding, index)
|
elif len(args) == 3: # (location, binding, index)
|
||||||
@@ -530,6 +530,12 @@ def do_spsso_descriptor(conf, cert=None):
|
|||||||
for val in vals:
|
for val in vals:
|
||||||
spsso.extensions.add_extension_element(val)
|
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:
|
if cert:
|
||||||
encryption_type = conf.encryption_type
|
encryption_type = conf.encryption_type
|
||||||
spsso.key_descriptor = do_key_descriptor(cert, encryption_type)
|
spsso.key_descriptor = do_key_descriptor(cert, encryption_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user