Ejemplo n.º 1
0
    def revocation_list(self, request):
        if not CONF.token.revoke_by_id:
            raise exception.Gone()

        audit_id_only = 'audit_id_only' in request.params

        tokens = PROVIDERS.token_provider_api.list_revoked_tokens()

        for t in tokens:
            expires = t['expires']
            if not (expires and isinstance(expires, six.text_type)):
                t['expires'] = utils.isotime(expires)
            if audit_id_only:
                t.pop('id', None)
        data = {'revoked': tokens}

        if audit_id_only:
            # No need to obfuscate if no token IDs.
            return data

        json_data = jsonutils.dumps(data)
        signed_text = cms.cms_sign_text(json_data, CONF.signing.certfile,
                                        CONF.signing.keyfile)

        return {'signed': signed_text}
Ejemplo n.º 2
0
 def revocation_list(self, request):
     if not CONF.token.revoke_by_id:
         raise exception.Gone()
     # NOTE(lbragstad): This API is deprecated and isn't supported. Keystone
     # also doesn't store tokens, so returning a list of revoked tokens
     # would require keystone to write invalid tokens to disk, which defeats
     # the purpose. Return a 403 instead of removing the API all together.
     # The alternative would be to return a signed response of just an empty
     # list.
     raise exception.Forbidden()
Ejemplo n.º 3
0
    def get(self):
        """Deprecated; get revoked token list.

        GET/HEAD /v3/auth/tokens/OS-PKI/revoked
        """
        if not CONF.token.revoke_by_id:
            raise exception.Gone()
        # NOTE(lbragstad): This API is deprecated and isn't supported. Keystone
        # also doesn't store tokens, so returning a list of revoked tokens
        # would require keystone to write invalid tokens to disk, which defeats
        # the purpose. Return a 403 instead of removing the API altogether.
        raise exception.Forbidden()
Ejemplo n.º 4
0
    def revocation_list(self, context, auth=None):
        if not CONF.token.revoke_by_id:
            raise exception.Gone()
        tokens = self.token_provider_api.list_revoked_tokens()

        for t in tokens:
            expires = t['expires']
            if expires and isinstance(expires, datetime.datetime):
                t['expires'] = timeutils.isotime(expires)
        data = {'revoked': tokens}
        json_data = jsonutils.dumps(data)
        signed_text = cms.cms_sign_text(json_data, CONF.signing.certfile,
                                        CONF.signing.keyfile)

        return {'signed': signed_text}
Ejemplo n.º 5
0
 def get(self):
     raise exception.Gone(
         message=_('This API is no longer available due to the removal'
                   'of support for PKI tokens. Returning a 410 instead'
                   'of removing the API'))
Ejemplo n.º 6
0
 def get(self):
     raise exception.Gone(
         message=_('This API is no longer available due to the removal '
                   'of support for PKI tokens.'))