Skip to content

Commit e3ac39a

Browse files
committed
Some cleanup
1 parent 54e8896 commit e3ac39a

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

tests/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def get_post_refresh_keys_response_with_no_default_keyset_key():
132132

133133
with self.assertRaises(EncryptionError) as context:
134134
client.encrypt(example_uid)
135-
self.assertEqual("('No Keyset Key Found',)", str(context.exception))
135+
self.assertEqual("No Keyset Key Found", str(context.exception))
136136

137137
def test_cannot_encrypt_if_theres_no_default_keyset_header(self, mock_refresh_keys_util):
138138
def get_post_refresh_keys_response_with_no_default_keyset_header():
@@ -146,7 +146,7 @@ def get_post_refresh_keys_response_with_no_default_keyset_header():
146146

147147
with self.assertRaises(EncryptionError) as context:
148148
client.encrypt(example_uid)
149-
self.assertEqual("('No Keyset Key Found',)", str(context.exception))
149+
self.assertEqual("No Keyset Key Found", str(context.exception))
150150

151151
def test_expiry_in_token_matches_expiry_in_response(self, mock_refresh_keys_util):
152152
def get_post_refresh_keys_response_with_token_expiry():
@@ -185,7 +185,7 @@ def get_post_refresh_keys_response_with_key_inactive():
185185

186186
with self.assertRaises(EncryptionError) as context:
187187
client.encrypt(example_uid)
188-
self.assertEqual("('No Keyset Key Found',)", str(context.exception))
188+
self.assertEqual("No Keyset Key Found", str(context.exception))
189189

190190
def test_encrypt_key_expired(self, mock_refresh_keys_util):
191191
def get_post_refresh_keys_response_with_key_expired():
@@ -199,4 +199,4 @@ def get_post_refresh_keys_response_with_key_expired():
199199

200200
with self.assertRaises(EncryptionError) as context:
201201
client.encrypt(example_uid)
202-
self.assertEqual("('No Keyset Key Found',)", str(context.exception))
202+
self.assertEqual("No Keyset Key Found", str(context.exception))

uid2_client/decryption_status.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33

44
class DecryptionStatus(Enum):
5-
DOMAIN_NAME_CHECK_FAILED = "domain_name_check_failed"
5+
DOMAIN_NAME_CHECK_FAILED = "domain name check failed"
66
INVALID_PAYLOAD = "invalid payload"
7-
INVALID_TOKEN_LIFETIME = "invalid_token_lifetime"
7+
INVALID_TOKEN_LIFETIME = "invalid token lifetime"
88
KEYS_NOT_SYNCED = "no keys available or all keys have expired; refresh the latest keys from UID2 service"
9-
NOT_AUTHORIZED_FOR_KEY = "not_authorized_for_key"
10-
NOT_AUTHORIZED_FOR_MASTER_KEY = "not_authorized_for_master_key"
9+
NOT_AUTHORIZED_FOR_KEY = "not authorized for key"
10+
NOT_AUTHORIZED_FOR_MASTER_KEY = "not authorized for master key"
1111
NOT_INITIALIZED = "keys not initialized"
1212
SUCCESS = "success"
1313
TOKEN_EXPIRED = "token expired"
1414
VERSION_NOT_SUPPORTED = "token version not supported"
15-
# TOKEN_DECRYPT_FAILURE = "token_decrypt_failure",
16-
# KEY_INACTIVE = "key_inactive",
17-
# ENCRYPTION_FAILURE = "encryption_failure"

uid2_client/encryption_status.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,5 @@
22

33

44
class EncryptionStatus(Enum):
5-
SUCCESS = "success",
6-
NOT_AUTHORIZED_FOR_KEY = "No Keyset Key Found",
7-
# NOT_AUTHORIZED_FOR_MASTER_KEY = "not_authorized_for_master_key",
8-
# NOT_INITIALIZED = "not_initialized",
9-
# KEYS_NOT_SYNCED = "keys_not_synced",
10-
# TOKEN_DECRYPT_FAILURE = "token_decrypt_failure",
11-
# KEY_INACTIVE = "key_inactive",
12-
# ENCRYPTION_FAILURE = "encryption_failure"
5+
SUCCESS = "success"
6+
NOT_AUTHORIZED_FOR_KEY = "No Keyset Key Found"

0 commit comments

Comments
 (0)