pysfemma.py
def stripBindingsNotSupported(self, entity):
        """
        Removes AssertionConsumerServices and SingleLogoutServices that uses
        bindings that ADFS does not support.
        Also removes AssertionConsumerServices endpoint that doesn't use HTTPS.
        Returns the modified entity or None if there are not remaining endpoints
        after filtering.

        :param entity: Entity Descriptor
        :return: Entity descriptor or None of no usable endpoints remained
        """

        _sps = []
        for sp in entity["spsso_descriptor"]:
            _acs = []
            for acs in sp["assertion_consumer_service"]:
                if acs["binding"] not in BINDINGS_NOT_SUPPORTED:
                    if acs["location"].startswith("https:"):
                        _acs.append(acs)
            _sls = []
            try:
                _slss = sp["single_logout_service"]
            except KeyError:
                pass
            else:
                for sls in _slss:
                    if sls["binding"] in BINDINGS_NOT_SUPPORTED:
                        print "Removed not supported binding: %s" % sls["binding"]
                        continue
                    else:
                        if sls["location"].startswith("https:"):
                            _sls.append(sls)
                        else:
                            print "Removed endpoint since not HTTPS"
                            continue

            if not _acs:
                continue
            else:
                sp["assertion_consumer_service"] = _acs
                sp["single_logout_service"] = _sls
                _sps.append(sp)

        if not _sps:
            return None
        else:
            entity["spsso_descriptor"] = _sps
            return entity

        Removes AssertionConsumerServices and SingleLogoutServices that uses
        bindings that ADFS does not support.
        Also removes AssertionConsumerServices endpoint that doesn't use HTTPS.
        Returns the modified entity or None if there are not remaining endpoints
        after filtering.

        :param entity: Entity Descriptor
        :return: Entity descriptor or None of no usable endpoints remained
        
Removes AssertionConsumerServices and SingleLogoutServices that uses
bindings that ADFS does not support.
Also removes AssertionConsumerServices endpoint that doesn't use HTTPS.
Returns the modified entity or None if there are not remaining endpoints
after filtering.
Removes AssertionConsumerServices and SingleLogoutServices that uses bindings that ADFS does not support . Also removes AssertionConsumerServices endpoint that doesn ' t use HTTPS . Returns the modified entity or None if there are not remaining endpoints after filtering .
def stripBindingsNotSupported(self, entity):
        _sps = []
        for sp in entity["spsso_descriptor"]:
            _acs = []
            for acs in sp["assertion_consumer_service"]:
                if acs["binding"] not in BINDINGS_NOT_SUPPORTED:
                    if acs["location"].startswith("https:"):
                        _acs.append(acs)
            _sls = []
            try:
                _slss = sp["single_logout_service"]
            except KeyError:
                pass
            else:
                for sls in _slss:
                    if sls["binding"] in BINDINGS_NOT_SUPPORTED:
                        print "Removed not supported binding: %s" % sls["binding"]
                        continue
                    else:
                        if sls["location"].startswith("https:"):
                            _sls.append(sls)
                        else:
                            print "Removed endpoint since not HTTPS"
                            continue
            if not _acs:
                continue
            else:
                sp["assertion_consumer_service"] = _acs
                sp["single_logout_service"] = _sls
                _sps.append(sp)
        if not _sps:
            return None
        else:
            entity["spsso_descriptor"] = _sps
            return entity
def stripBindingsNotSupported ( self , entity ) : _sps = [ ] for sp in entity [ "spsso_descriptor" ] : _acs = [ ] for acs in sp [ "assertion_consumer_service" ] : if acs [ "binding" ] not in BINDINGS_NOT_SUPPORTED : if acs [ "location" ] . startswith ( "https:" ) : _acs . append ( acs ) _sls = [ ] try : _slss = sp [ "single_logout_service" ] except KeyError : pass else : for sls in _slss : if sls [ "binding" ] in BINDINGS_NOT_SUPPORTED : print "Removed not supported binding: %s" % sls [ "binding" ] continue else : if sls [ "location" ] . startswith ( "https:" ) : _sls . append ( sls ) else : print "Removed endpoint since not HTTPS" continue if not _acs : continue else : sp [ "assertion_consumer_service" ] = _acs sp [ "single_logout_service" ] = _sls _sps . append ( sp ) if not _sps : return None else : entity [ "spsso_descriptor" ] = _sps return entity
Removes AssertionConsumerServices and SingleLogoutServices that uses
bindings that ADFS does not support.
Removes AssertionConsumerServices and SingleLogoutServices that uses bindings that ADFS does not support .
"""
        Removes AssertionConsumerServices and SingleLogoutServices that uses
        bindings that ADFS does not support.
        Also removes AssertionConsumerServices endpoint that doesn't use HTTPS.
        Returns the modified entity or None if there are not remaining endpoints
        after filtering.

        :param entity: Entity Descriptor
        :return: Entity descriptor or None of no usable endpoints remained
        """
Entity descriptor or None of no usable endpoints remained
Entity descriptor or None of no usable endpoints remained
self
entity
None