Esempio n. 1
0
    def on_delete(self, keystone_id, **kwargs):

        secret_model = self.repos.secret_repo.get(entity_id=self.secret_id,
                                                  keystone_id=keystone_id,
                                                  suppress_exception=True)
        if not secret_model:
            _secret_not_found()

        plugin.delete_secret(secret_model, keystone_id, self.repos)
Esempio n. 2
0
    def on_delete(self, external_project_id, **kwargs):

        secret_model = self.repos.secret_repo.get(
            entity_id=self.secret_id,
            external_project_id=external_project_id,
            suppress_exception=True)
        if not secret_model:
            _secret_not_found()

        plugin.delete_secret(secret_model, external_project_id, self.repos)
Esempio n. 3
0
    def on_delete(self, external_project_id, **kwargs):
        secret_consumers = self.consumer_repo.get_by_secret_id(
            self.secret.id, suppress_exception=True)
        plugin.delete_secret(self.secret, external_project_id)
        LOG.info('Deleted secret for project: %s', external_project_id)

        for consumer in secret_consumers[0]:
            try:
                self.consumer_repo.delete_entity_by_id(consumer.id,
                                                       external_project_id)
            except exception.NotFound:  # nosec
                pass
Esempio n. 4
0
    def on_delete(self, external_project_id, **kwargs):
        secret_consumers = self.consumer_repo.get_by_secret_id(
            self.secret.id, suppress_exception=True)

        # With ACL support, the user token project does not have to be same as
        # project associated with secret. The lookup project_id needs to be
        # derived from the secret's data considering authorization is already
        # done.
        external_project_id = self.secret.project.external_id
        plugin.delete_secret(self.secret, external_project_id)
        LOG.info('Deleted secret for project: %s', external_project_id)

        for consumer in secret_consumers[0]:
            try:
                self.consumer_repo.delete_entity_by_id(consumer.id,
                                                       external_project_id)
            except exception.NotFound:  # nosec
                pass
Esempio n. 5
0
 def on_delete(self, external_project_id, **kwargs):
     plugin.delete_secret(self.secret, external_project_id)
     LOG.info('Deleted secret for project: %s', external_project_id)
Esempio n. 6
0
 def on_delete(self, external_project_id, **kwargs):
     plugin.delete_secret(self.secret, external_project_id)
     LOG.info(u._LI('Deleted secret for project: %s'), external_project_id)