Skip to content

Commit 10101cb

Browse files
committed
use python 3.8 compatible version of dict type
1 parent ef84cba commit 10101cb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

workos/utils/crypto_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
from typing import Optional
2+
from typing import Optional, Dict
33
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
44
from cryptography.hazmat.backends import default_backend
55

66

77
class CryptoProvider:
88
def encrypt(
99
self, plaintext: bytes, key: bytes, iv: bytes, aad: Optional[bytes]
10-
) -> dict[str, bytes]:
10+
) -> Dict[str, bytes]:
1111
encryptor = Cipher(
1212
algorithms.AES(key), modes.GCM(iv), backend=default_backend()
1313
).encryptor()

workos/vault.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import json
21
import base64
32
import struct
4-
from typing import Any, Mapping, Optional, Protocol, Sequence
5-
from workos.types.vault import VaultObject, ObjectMetadata, ObjectVersion
3+
from typing import Dict, Optional, Protocol, Sequence
4+
from workos.types.vault import VaultObject, ObjectVersion
65
from workos.types.vault.key import DataKey, DataKeyPair, KeyContext
76
from workos.types.list_resource import (
87
ListArgs,
@@ -423,7 +422,7 @@ def _bytes_to_base64(self, data: bytes) -> str:
423422
def _encode_uint32(self, value: int) -> bytes:
424423
return struct.pack(">I", value) # Big-endian unsigned int (4 bytes)
425424

426-
def _decode(self, encrypted_data_b64: str) -> dict[str, bytes]:
425+
def _decode(self, encrypted_data_b64: str) -> Dict[str, bytes]:
427426
"""
428427
This function extracts IV, tag, keyBlobLength, keyBlob, and ciphertext
429428
from a base64-encoded payload. You must define this according to your encoding format.

0 commit comments

Comments
 (0)