pysfemma.py
def extract(self):
        """
        Creates separate metadata file for each Service Provider entityID in
        the original metadata files.

        It will weed out SPs that fulfills any of these criteria:
        1. no valid keys
        2. no Assertion Consuming Services endpoints with bindings supported by
            ADFS
        3. no HTTPS based Assertion Consuming Service endpoints
        """
        pshScript = ""
        pshScriptTemplate = Template(open(self.powershell_metadata_update,
                                          'r').read())

        # for EntityDescriptor extracts SP and write a single metadata file
        for eid, entity in self.mds.items():
            if "spsso_descriptor" in entity:
                if not self.entity_to_ignore(eid):
                    print "---- %s ----" % eid
                    entity = self.stripRolloverKeys(entity)
                    if not entity:
                        print "No working keys for %s" % eid
                        continue
                    entity = self.stripBindingsNotSupported(entity)
                    if not entity:
                        print "No working endpoints for %s" % eid
                        continue

                    fname = eid.replace('/', '_').replace('.', '_').replace(
                        ':', '_')
                    fname = "".join(
                        [x for x in fname
                         if x.isalpha() or x.isdigit() or x == '-' or x == '_'])

                    print " ".join(["Generating XML metadata for", eid])
                    entityFileName = pjoin(self.metadata_dir,
                                           fname + ".xml")
                    entityFile = open(entityFileName, "w")
                    entityFile.write("%s" % from_dict(entity, ONTS))
                    entityFile.close()
                    rulesetFileName = pjoin(self.ruleset_dir, fname)
                    self.ruleset_creation(self.my_claim_type,
                                          rulesetFileName, entity)
                    pshScript += pshScriptTemplate.substitute(
                        fedName=self.fed_name_prefix,
                        metadataFile=entityFileName,
                        rpName=eid,
                        rulesetFile=rulesetFileName)

        if pshScript:
            print "Generating powershell script for Relying Party configuration update..."
            pshScriptBaseTemplate = Template(open(self.powershell_base,
                                                  'r').read())
            pshScript = pshScriptBaseTemplate.substitute(
                fedName=self.fed_name_prefix) + pshScript
            pshScriptFile = open('update_adfs_rptrust.ps1', 'w')
            pshScriptFile.write(pshScript)
            pshScriptFile.close()

        Creates separate metadata file for each Service Provider entityID in
        the original metadata files.

        It will weed out SPs that fulfills any of these criteria:
        1. no valid keys
        2. no Assertion Consuming Services endpoints with bindings supported by
            ADFS
        3. no HTTPS based Assertion Consuming Service endpoints
        
Creates separate metadata file for each Service Provider entityID in
the original metadata files.

It will weed out SPs that fulfills any of these criteria:
1. no valid keys
2. no Assertion Consuming Services endpoints with bindings supported by
ADFS
3. no HTTPS based Assertion Consuming Service endpoints
Creates separate metadata file for each Service Provider entityID in the original metadata files . It will weed out SPs that fulfills any of these criteria : 1 . no valid keys 2 . no Assertion Consuming Services endpoints with bindings supported by ADFS 3 . no HTTPS based Assertion Consuming Service endpoints
def extract(self):
        pshScript = ""
        pshScriptTemplate = Template(open(self.powershell_metadata_update,
                                          'r').read())
        for eid, entity in self.mds.items():
            if "spsso_descriptor" in entity:
                if not self.entity_to_ignore(eid):
                    print "---- %s ----" % eid
                    entity = self.stripRolloverKeys(entity)
                    if not entity:
                        print "No working keys for %s" % eid
                        continue
                    entity = self.stripBindingsNotSupported(entity)
                    if not entity:
                        print "No working endpoints for %s" % eid
                        continue
                    fname = eid.replace('/', '_').replace('.', '_').replace(
                        ':', '_')
                    fname = "".join(
                        [x for x in fname
                         if x.isalpha() or x.isdigit() or x == '-' or x == '_'])
                    print " ".join(["Generating XML metadata for", eid])
                    entityFileName = pjoin(self.metadata_dir,
                                           fname + ".xml")
                    entityFile = open(entityFileName, "w")
                    entityFile.write("%s" % from_dict(entity, ONTS))
                    entityFile.close()
                    rulesetFileName = pjoin(self.ruleset_dir, fname)
                    self.ruleset_creation(self.my_claim_type,
                                          rulesetFileName, entity)
                    pshScript += pshScriptTemplate.substitute(
                        fedName=self.fed_name_prefix,
                        metadataFile=entityFileName,
                        rpName=eid,
                        rulesetFile=rulesetFileName)
        if pshScript:
            print "Generating powershell script for Relying Party configuration update..."
            pshScriptBaseTemplate = Template(open(self.powershell_base,
                                                  'r').read())
            pshScript = pshScriptBaseTemplate.substitute(
                fedName=self.fed_name_prefix) + pshScript
            pshScriptFile = open('update_adfs_rptrust.ps1', 'w')
            pshScriptFile.write(pshScript)
            pshScriptFile.close()
def extract ( self ) : pshScript = "" pshScriptTemplate = Template ( open ( self . powershell_metadata_update , 'r' ) . read ( ) ) for eid , entity in self . mds . items ( ) : if "spsso_descriptor" in entity : if not self . entity_to_ignore ( eid ) : print "---- %s ----" % eid entity = self . stripRolloverKeys ( entity ) if not entity : print "No working keys for %s" % eid continue entity = self . stripBindingsNotSupported ( entity ) if not entity : print "No working endpoints for %s" % eid continue fname = eid . replace ( '/' , '_' ) . replace ( '.' , '_' ) . replace ( ':' , '_' ) fname = "" . join ( [ x for x in fname if x . isalpha ( ) or x . isdigit ( ) or x == '-' or x == '_' ] ) print " " . join ( [ "Generating XML metadata for" , eid ] ) entityFileName = pjoin ( self . metadata_dir , fname + ".xml" ) entityFile = open ( entityFileName , "w" ) entityFile . write ( "%s" % from_dict ( entity , ONTS ) ) entityFile . close ( ) rulesetFileName = pjoin ( self . ruleset_dir , fname ) self . ruleset_creation ( self . my_claim_type , rulesetFileName , entity ) pshScript += pshScriptTemplate . substitute ( fedName = self . fed_name_prefix , metadataFile = entityFileName , rpName = eid , rulesetFile = rulesetFileName ) if pshScript : print "Generating powershell script for Relying Party configuration update..." pshScriptBaseTemplate = Template ( open ( self . powershell_base , 'r' ) . read ( ) ) pshScript = pshScriptBaseTemplate . substitute ( fedName = self . fed_name_prefix ) + pshScript pshScriptFile = open ( 'update_adfs_rptrust.ps1' , 'w' ) pshScriptFile . write ( pshScript ) pshScriptFile . close ( )
Creates separate metadata file for each Service Provider entityID in
the original metadata files.
Creates separate metadata file for each Service Provider entityID in the original metadata files .
"""
        Creates separate metadata file for each Service Provider entityID in
        the original metadata files.

        It will weed out SPs that fulfills any of these criteria:
        1. no valid keys
        2. no Assertion Consuming Services endpoints with bindings supported by
            ADFS
        3. no HTTPS based Assertion Consuming Service endpoints
        """ # for EntityDescriptor extracts SP and write a single metadata file
self