|
29 | 29 | ) |
30 | 30 |
|
31 | 31 | from vaultwarden.clients.bitwarden import BitwardenAPIClient |
32 | | -from vaultwarden.models.enum import CipherType, OrganizationUserType, KdfType |
| 32 | +from vaultwarden.models.enum import CipherType, KdfType, OrganizationUserType |
33 | 33 | from vaultwarden.models.exception_models import BitwardenError |
34 | 34 | from vaultwarden.models.permissive_model import PermissiveBaseModel |
35 | 35 | from vaultwarden.utils.crypto import decrypt, encrypt |
@@ -74,7 +74,8 @@ def decode_bytes( |
74 | 74 | return decrypt(handler(value), key) |
75 | 75 | except Exception: |
76 | 76 | continue |
77 | | - raise ValueError(f"No key found") |
| 77 | + raise ValueError("No key found") |
| 78 | + |
78 | 79 |
|
79 | 80 | def decode_string( |
80 | 81 | value: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo |
@@ -229,9 +230,7 @@ def set_key( |
229 | 230 | context = cast(dict, info.context) |
230 | 231 | cctx = cast(list[bytes], context.get("cctx")) |
231 | 232 |
|
232 | | - cctx.append( |
233 | | - decrypt(key, cctx[0]) |
234 | | - ) |
| 233 | + cctx.append(decrypt(key, cctx[0])) |
235 | 234 |
|
236 | 235 | v = handler(data) |
237 | 236 |
|
@@ -801,7 +800,7 @@ def _get_ciphers(self) -> list[CipherDetails]: |
801 | 800 | context={ |
802 | 801 | "parent_id": self.Id, |
803 | 802 | "client": self.api_client, |
804 | | - "cctx": [org_key], # crypto context |
| 803 | + "cctx": [org_key], # crypto context |
805 | 804 | }, |
806 | 805 | ) |
807 | 806 | return res.Data |
|
0 commit comments