def do_pdp_descriptor(conf, cert): """ Create a Policy Decision Point descriptor """ pdp = md.PDPDescriptor() pdp.protocol_support_enumeration = samlp.NAMESPACE endps = conf.getattr("endpoints", "pdp") if endps: for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["pdp"]).items(): setattr(pdp, endpoint, instlist) namef = conf.getattr("name_form", "pdp") if namef: if isinstance(namef, basestring): ids = [md.NameIDFormat(namef)] else: ids = [md.NameIDFormat(text=form) for form in namef] setattr(pdp, "name_id_format", ids) if cert: pdp.key_descriptor = do_key_descriptor(cert) return pdp
def do_pdp_descriptor(conf, cert): """ Create a Policy Decision Point descriptor """ pdp = md.PDPDescriptor() pdp.protocol_support_enumeration = samlp.NAMESPACE endps = conf.getattr("endpoints", "pdp") if endps: for (endpoint, instlist) in do_endpoints(endps, ENDPOINTS["pdp"]).items(): setattr(pdp, endpoint, instlist) _do_nameid_format(pdp, conf, "pdp") if cert: pdp.key_descriptor = do_key_descriptor(cert) return pdp