Warning: This document is for the development version of iam-python-sdk.

Source code for iam_python_sdk.errors

# Copyright 2021 AccelByte Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Error module."""


[docs]class Error(Exception): """Base error class.""" def __init__(self, message: str = "") -> None: if message: self.message = message super().__init__(self.message)
[docs]class UnauthorizedError(Error): message = "access unauthorized, make sure you have valid client access token using ClientTokenGrant"
[docs]class ForbiddenError(Error): message = "access forbidden, make sure you have client creds that has sufficient permission"
[docs]class UserRevokedError(Error): message = "user has been revoked"
[docs]class TokenRevokedError(Error): message = "token has been revoked"
[docs]class NilClaimError(Error): message = "claims is nil"
[docs]class InvalidAudError(Error): message = "audience doesn't match the client's base uri. access denied"
[docs]class InvalidScopeError(Error): message = "insufficient scope"
[docs]class EmptyTokenError(Error): message = "token is empty"
[docs]class InvalidTokenSignatureKeyError(Error): message = "invalid token signature key ID"
[docs]class RoleNotFoundError(Error): message = "role not found"
[docs]class NoLocalValidationError(Error): message = "local validation is not active, activate by calling StartLocalValidation()"
[docs]class HTTPClientError(Error): pass
[docs]class ClientTokenGrantError(Error): pass
[docs]class ClientDelegateTokenGrantError(Error): pass
[docs]class RefreshAccessTokenError(Error): pass
[docs]class GetJWKSError(Error): pass
[docs]class GetRevocationListError(Error): pass
[docs]class StartLocalValidationError(Error): pass
[docs]class ValidatePermissionError(Error): pass
[docs]class ValidateAccessTokenError(Error): pass
[docs]class ValidateAndParseClaimsError(Error): pass
[docs]class ValidateJWTError(Error): pass
[docs]class ValidateScopeError(Error): pass
[docs]class ValidateAudienceError(Error): pass
[docs]class GetRolePermissionError(Error): pass
[docs]class GetClientInformationError(Error): pass
[docs]class GetNamespaceContextError(Error): pass