Fixed error with backward reference
This commit is contained in:
@@ -28,20 +28,35 @@ def do_sp_sso_descriptor(sp, cert, backward_map):
|
|||||||
requested_attribute = []
|
requested_attribute = []
|
||||||
if "required_attributes" in sp:
|
if "required_attributes" in sp:
|
||||||
for attr in sp["required_attributes"]:
|
for attr in sp["required_attributes"]:
|
||||||
requested_attribute.append({
|
try:
|
||||||
"is_required": "true",
|
requested_attribute.append({
|
||||||
"friendly_name": attr,
|
"is_required": "true",
|
||||||
"name_format": NAME_FORMAT_URI,
|
"friendly_name": attr,
|
||||||
"name": backward_map[attr]
|
"name_format": NAME_FORMAT_URI,
|
||||||
})
|
"name": backward_map[attr]
|
||||||
|
})
|
||||||
|
except KeyError:
|
||||||
|
requested_attribute.append({
|
||||||
|
"is_required": "true",
|
||||||
|
"friendly_name": attr,
|
||||||
|
"name_format": NAME_FORMAT_URI,
|
||||||
|
"name": attr
|
||||||
|
})
|
||||||
|
|
||||||
if "optional_attributes" in sp:
|
if "optional_attributes" in sp:
|
||||||
for attr in sp["optional_attributes"]:
|
for attr in sp["optional_attributes"]:
|
||||||
requested_attribute.append({
|
try:
|
||||||
"friendly_name": attr,
|
requested_attribute.append({
|
||||||
"name_format": NAME_FORMAT_URI,
|
"friendly_name": attr,
|
||||||
"name": backward_map[attr]
|
"name_format": NAME_FORMAT_URI,
|
||||||
})
|
"name": backward_map[attr]
|
||||||
|
})
|
||||||
|
except KeyError:
|
||||||
|
requested_attribute.append({
|
||||||
|
"friendly_name": attr,
|
||||||
|
"name_format": NAME_FORMAT_URI,
|
||||||
|
"name": attr
|
||||||
|
})
|
||||||
|
|
||||||
if requested_attribute:
|
if requested_attribute:
|
||||||
desc["attribute_consuming_service"] = {
|
desc["attribute_consuming_service"] = {
|
||||||
@@ -90,10 +105,11 @@ def do_aa_descriptor(aa, cert):
|
|||||||
def entity_descriptor(confd):
|
def entity_descriptor(confd):
|
||||||
mycert = "".join(open(confd["cert_file"]).readlines()[1:-1])
|
mycert = "".join(open(confd["cert_file"]).readlines()[1:-1])
|
||||||
|
|
||||||
backward_map = {}
|
|
||||||
if "attribute_maps" in confd:
|
if "attribute_maps" in confd:
|
||||||
(forward,backward) = parse_attribute_map(confd["attribute_maps"])
|
(forward,backward) = parse_attribute_map(confd["attribute_maps"])
|
||||||
|
else:
|
||||||
|
backward = {}
|
||||||
|
|
||||||
ed = {
|
ed = {
|
||||||
"name": "http://%s/saml/test" % os.uname()[1],
|
"name": "http://%s/saml/test" % os.uname()[1],
|
||||||
"valid_until": in_a_while(hours=96),
|
"valid_until": in_a_while(hours=96),
|
||||||
|
|||||||
Reference in New Issue
Block a user