|
1 | 1 | """PackagingService interface.""" |
2 | 2 |
|
3 | | -from dataclasses import dataclass |
4 | 3 | import hashlib |
| 4 | +from dataclasses import dataclass |
5 | 5 | from typing import Generic, Literal, Optional, Sequence, Tuple, Union |
6 | 6 |
|
7 | 7 | from pydid import DIDUrl, VerificationMethod |
8 | | -from didcomm_messaging.crypto import P, S, CryptoService, SecretsManager |
| 8 | + |
| 9 | +from didcomm_messaging.crypto import CryptoService, P, S, SecretsManager |
9 | 10 | from didcomm_messaging.crypto.jwe import JweEnvelope, b64url, from_b64url |
10 | 11 | from didcomm_messaging.resolver import DIDResolver |
11 | 12 |
|
@@ -40,7 +41,9 @@ async def extract_packed_message_metadata( # noqa: C901 |
40 | 41 | if not alg: |
41 | 42 | raise PackagingServiceError("Missing alg header") |
42 | 43 |
|
43 | | - method = next((m for m in ("ECDH-1PU", "ECDH-ES") if m in alg), None) |
| 44 | + method: Literal["ECDH-1PU", "ECDH-ES"] | None = next( |
| 45 | + (m for m in ("ECDH-1PU", "ECDH-ES") if m in alg), None |
| 46 | + ) |
44 | 47 | if not method: |
45 | 48 | raise PackagingServiceError( |
46 | 49 | f"Unsupported DIDComm encryption algorithm: {alg}" |
@@ -171,7 +174,6 @@ async def pack( |
171 | 174 | message: bytes, |
172 | 175 | to: Sequence[str], |
173 | 176 | frm: Optional[str] = None, |
174 | | - **options, |
175 | 177 | ): |
176 | 178 | """Pack a DIDComm message.""" |
177 | 179 | recip_keys = [ |
|
0 commit comments