Пример #1
0
    def on_get(self, external_project_id, **kw):
        LOG.debug('Start certificate_authorities on_get (limited)')

        plugin_name = kw.get('plugin_name')
        if plugin_name is not None:
            plugin_name = parse.unquote_plus(plugin_name)

        plugin_ca_id = kw.get('plugin_ca_id', None)
        if plugin_ca_id is not None:
            plugin_ca_id = parse.unquote_plus(plugin_ca_id)

        # refresh CA table, in case plugin entries have expired
        cert_resources.refresh_certificate_resources()

        project_model = res.get_or_create_project(external_project_id)

        if self._project_cas_defined(project_model.id):
            cas, offset, limit, total = self._get_subcas_and_project_cas(
                offset=kw.get('offset', 0),
                limit=kw.get('limit', None),
                plugin_name=plugin_name,
                plugin_ca_id=plugin_ca_id,
                project_id=project_model.id)
        else:
            cas, offset, limit, total = self._get_subcas_and_root_cas(
                offset=kw.get('offset', 0),
                limit=kw.get('limit', None),
                plugin_name=plugin_name,
                plugin_ca_id=plugin_ca_id,
                project_id=project_model.id)

        return self._display_cas(cas, offset, limit, total)
Пример #2
0
    def on_get(self, external_project_id, **kw):
        LOG.debug('Start certificate_authorities on_get (limited)')

        plugin_name = kw.get('plugin_name')
        if plugin_name is not None:
            plugin_name = parse.unquote_plus(plugin_name)

        plugin_ca_id = kw.get('plugin_ca_id', None)
        if plugin_ca_id is not None:
            plugin_ca_id = parse.unquote_plus(plugin_ca_id)

        # refresh CA table, in case plugin entries have expired
        cert_resources.refresh_certificate_resources()

        project_model = res.get_or_create_project(external_project_id)

        if self._project_cas_defined(project_model.id):
            cas, offset, limit, total = self._get_subcas_and_project_cas(
                offset=kw.get('offset', 0),
                limit=kw.get('limit', None),
                plugin_name=plugin_name,
                plugin_ca_id=plugin_ca_id,
                project_id=project_model.id)
        else:
            cas, offset, limit, total = self._get_subcas_and_root_cas(
                offset=kw.get('offset', 0),
                limit=kw.get('limit', None),
                plugin_name=plugin_name,
                plugin_ca_id=plugin_ca_id,
                project_id=project_model.id)

        return self._display_cas(cas, offset, limit, total)
Пример #3
0
 def __init__(self):
     LOG.debug('Creating CertificateAuthoritiesController')
     self.ca_repo = repo.get_ca_repository()
     self.project_ca_repo = repo.get_project_ca_repository()
     self.preferred_ca_repo = repo.get_preferred_ca_repository()
     self.project_repo = repo.get_project_repository()
     self.validator = validators.NewCAValidator()
     self.quota_enforcer = quota.QuotaEnforcer('cas', self.ca_repo)
     # Populate the CA table at start up
     cert_resources.refresh_certificate_resources()
Пример #4
0
 def __init__(self):
     LOG.debug('Creating CertificateAuthoritiesController')
     self.ca_repo = repo.get_ca_repository()
     self.project_ca_repo = repo.get_project_ca_repository()
     self.preferred_ca_repo = repo.get_preferred_ca_repository()
     self.project_repo = repo.get_project_repository()
     self.validator = validators.NewCAValidator()
     self.quota_enforcer = quota.QuotaEnforcer('cas', self.ca_repo)
     # Populate the CA table at start up
     cert_resources.refresh_certificate_resources()