summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-03-13 15:08:55 -0300
committerdrebs <drebs@leap.se>2014-03-17 12:17:51 -0300
commit288f506daed66e4acb08617dc1db127da4d36241 (patch)
treebadb508a7f330269994a524c8b9e545b12b903f4 /common
parentff63167fbb4391a063fdbc29903fdad5a48c55bc (diff)
Fix raising of auth token errors (#5191).
Diffstat (limited to 'common')
-rw-r--r--common/src/leap/soledad/common/errors.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/common/src/leap/soledad/common/errors.py b/common/src/leap/soledad/common/errors.py
index 446c4c75..3a7eadd2 100644
--- a/common/src/leap/soledad/common/errors.py
+++ b/common/src/leap/soledad/common/errors.py
@@ -51,23 +51,15 @@ class SoledadError(errors.U1DBError):
#
@register_exception
-class MissingAuthTokenError(errors.Unauthorized):
- """
- Exception raised when failing to get authorization for some action because
- the auth token is missing in the tokens db.
- """
-
- wire_description = "missing token"
- status = 401
-
-@register_exception
class InvalidAuthTokenError(errors.Unauthorized):
"""
Exception raised when failing to get authorization for some action because
- the provided token is different from the one in the tokens db.
+ the provided token either does not exist in the tokens database, has a
+ distinct structure from the expected one, or is associated with a user
+ with a distinct uuid than the one provided by the client.
"""
- wire_descrition = "token mismatch"
+ wire_descrition = "invalid auth token"
status = 401
#