vaultmanager/modules/VaultManagerLDAP.py
def ldap_create_groups_secrets(self):
        """
        Method running the create-groups-secrets function of LDAP module
        Create a secret folder for each LDAP group under specified path
        """
        self.logger.debug("LDAP create-groups-secrets starting")
        self.logger.info("Creating groups folders under secret path '/%s'" %
                         self.kwargs.create_groups_secrets)
        self.logger.debug("Creating groups secrets under %s" %
                          self.kwargs.create_groups_secrets)
        existing_folders = self.vault_client.list(
            self.kwargs.create_groups_secrets
        )
        if len(existing_folders):
            existing_folders = [e.replace("/", "") for e in
                                existing_folders['keys']]
        self.logger.debug("Already existing folders: " + str(existing_folders))
        for group in self.conf["groups"]["groups_to_add"]:
            if group not in existing_folders:
                self.logger.info("Creating folder: " + group)
                self.vault_client.write(self.kwargs.create_groups_secrets +
                                        "/" + group + "/description",
                                        {group: "group private secrets space"})
        for group in existing_folders:
            if group not in self.conf["groups"]["groups_to_add"]:
                tree = self.vault_client.get_secrets_tree(
                    self.kwargs.create_groups_secrets + "/" + group)
                self.logger.info(
                    "Deleting folder " + group + " and associated secrets " + str(
                        tree))
                for secret in tree:
                    self.vault_client.delete(secret)

        Method running the create-groups-secrets function of LDAP module
        Create a secret folder for each LDAP group under specified path
        
Method running the create-groups-secrets function of LDAP module
Create a secret folder for each LDAP group under specified path
Method running the create - groups - secrets function of LDAP module Create a secret folder for each LDAP group under specified path
def ldap_create_groups_secrets(self):
        self.logger.debug("LDAP create-groups-secrets starting")
        self.logger.info("Creating groups folders under secret path '/%s'" %
                         self.kwargs.create_groups_secrets)
        self.logger.debug("Creating groups secrets under %s" %
                          self.kwargs.create_groups_secrets)
        existing_folders = self.vault_client.list(
            self.kwargs.create_groups_secrets
        )
        if len(existing_folders):
            existing_folders = [e.replace("/", "") for e in
                                existing_folders['keys']]
        self.logger.debug("Already existing folders: " + str(existing_folders))
        for group in self.conf["groups"]["groups_to_add"]:
            if group not in existing_folders:
                self.logger.info("Creating folder: " + group)
                self.vault_client.write(self.kwargs.create_groups_secrets +
                                        "/" + group + "/description",
                                        {group: "group private secrets space"})
        for group in existing_folders:
            if group not in self.conf["groups"]["groups_to_add"]:
                tree = self.vault_client.get_secrets_tree(
                    self.kwargs.create_groups_secrets + "/" + group)
                self.logger.info(
                    "Deleting folder " + group + " and associated secrets " + str(
                        tree))
                for secret in tree:
                    self.vault_client.delete(secret)
def ldap_create_groups_secrets ( self ) : self . logger . debug ( "LDAP create-groups-secrets starting" ) self . logger . info ( "Creating groups folders under secret path '/%s'" % self . kwargs . create_groups_secrets ) self . logger . debug ( "Creating groups secrets under %s" % self . kwargs . create_groups_secrets ) existing_folders = self . vault_client . list ( self . kwargs . create_groups_secrets ) if len ( existing_folders ) : existing_folders = [ e . replace ( "/" , "" ) for e in existing_folders [ 'keys' ] ] self . logger . debug ( "Already existing folders: " + str ( existing_folders ) ) for group in self . conf [ "groups" ] [ "groups_to_add" ] : if group not in existing_folders : self . logger . info ( "Creating folder: " + group ) self . vault_client . write ( self . kwargs . create_groups_secrets + "/" + group + "/description" , { group : "group private secrets space" } ) for group in existing_folders : if group not in self . conf [ "groups" ] [ "groups_to_add" ] : tree = self . vault_client . get_secrets_tree ( self . kwargs . create_groups_secrets + "/" + group ) self . logger . info ( "Deleting folder " + group + " and associated secrets " + str ( tree ) ) for secret in tree : self . vault_client . delete ( secret )
Method running the create-groups-secrets function of LDAP module
Create a secret folder for each LDAP group under specified path
Method running the create - groups - secrets function of LDAP module Create a secret folder for each LDAP group under specified path
"""
        Method running the create-groups-secrets function of LDAP module
        Create a secret folder for each LDAP group under specified path
        """
self