Skip to content

Commit 00bfded

Browse files
authored
Merge pull request #32 from Indicio-tech/chore/quick-updates
chore: update dependencies, dependabot config
2 parents f8ecfd6 + 5986c5f commit 00bfded

File tree

13 files changed

+322
-363
lines changed

13 files changed

+322
-363
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# For details on how this file works refer to:
2+
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
version: 2
4+
updates:
5+
# Maintain dependencies for GitHub Actions
6+
# - Check for updates once a week
7+
# - Group all updates into a single PR
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
groups:
13+
all-actions:
14+
patterns: ["*"]
15+
16+
# Maintain pip dependencies
17+
- package-ecosystem: pip
18+
directory: /
19+
schedule:
20+
interval: daily

.github/workflows/code-quality-check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
- uses: psf/[email protected]
1817
- uses: chartboost/ruff-action@v1
18+
with:
19+
version: "0.4.1"
20+
args: 'format --check'
21+
- uses: chartboost/ruff-action@v1
22+
with:
23+
version: "0.4.1"

.pre-commit-config.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ repos:
77
stages: [commit-msg]
88
args: ["--config", ".commitlint.config.js"]
99
additional_dependencies: ['@commitlint/config-conventional']
10-
- repo: https://github.com/psf/black
11-
rev: 23.7.0
12-
hooks:
13-
- id: black
14-
stages: [commit]
1510
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.0.284
11+
rev: v0.4.1
1712
hooks:
1813
- id: ruff
1914
stages: [commit]
2015
args: ["--fix", "--exit-non-zero-on-fix"]
16+
- id: ruff-format
17+
stages: [commit]

didcomm_messaging/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""DIDComm Messaging."""
2+
23
from dataclasses import dataclass
34
import json
45
from typing import Generic, Optional, List

didcomm_messaging/crypto/backend/askar.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Askar backend for DIDComm Messaging."""
2+
23
from collections import OrderedDict
34
import hashlib
45
import json
@@ -133,9 +134,7 @@ def kid(self) -> str:
133134
class AskarCryptoService(CryptoService[AskarKey, AskarSecretKey]):
134135
"""CryptoService backend implemented using Askar."""
135136

136-
async def ecdh_es_encrypt(
137-
self, to_keys: Sequence[AskarKey], message: bytes
138-
) -> bytes:
137+
async def ecdh_es_encrypt(self, to_keys: Sequence[AskarKey], message: bytes) -> bytes:
139138
"""Encode a message into DIDComm v2 anonymous encryption."""
140139
builder = JweBuilder(with_flatten_recipients=False)
141140

@@ -225,9 +224,7 @@ async def ecdh_es_decrypt(
225224
"A256CBC-HS512",
226225
"XC20P",
227226
):
228-
raise CryptoServiceError(
229-
f"Unsupported ECDH-ES content encryption: {enc_alg}"
230-
)
227+
raise CryptoServiceError(f"Unsupported ECDH-ES content encryption: {enc_alg}")
231228

232229
epk_header = recip.header.get("epk")
233230
if not epk_header:
@@ -239,9 +236,7 @@ async def ecdh_es_decrypt(
239236
raise CryptoServiceError("Error loading ephemeral key")
240237

241238
try:
242-
cek = ecdh.EcdhEs(
243-
alg_id, None, wrapper.apv_bytes
244-
).receiver_unwrap_key( # type: ignore
239+
cek = ecdh.EcdhEs(alg_id, None, wrapper.apv_bytes).receiver_unwrap_key( # type: ignore
245240
wrap_alg,
246241
enc_alg,
247242
epk,

didcomm_messaging/crypto/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""CryptoService and SecretsManager interfaces for DIDComm Messaging."""
22

3-
43
from abc import ABC, abstractmethod
54
from typing import Generic, Mapping, Optional, Sequence, TypeVar, Union
65

didcomm_messaging/crypto/jwe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ def _deserialize(cls, parsed: Mapping[str, Any]) -> "JweEnvelope": # noqa: C901
256256
try:
257257
protected: dict = json.loads(from_b64url(protected_b64))
258258
except json.JSONDecodeError:
259-
raise ValueError(
260-
"Invalid JWE: invalid JSON for protected headers"
261-
) from None
259+
raise ValueError("Invalid JWE: invalid JSON for protected headers") from None
262260
unprotected = parsed.get("unprotected") or {}
263261
if protected.keys() & unprotected.keys():
264262
raise ValueError("Invalid JWE: duplicate header")

didcomm_messaging/packaging.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""PackagingService interface."""
22

3-
43
from dataclasses import dataclass
54
import hashlib
65
from typing import Generic, Literal, Optional, Sequence, Tuple, Union
@@ -179,9 +178,7 @@ async def pack(
179178
await self.recip_for_kid_or_default_for_did(crypto, resolver, kid)
180179
for kid in to
181180
]
182-
sender_kid = (
183-
await self.default_sender_kid_for_did(resolver, frm) if frm else None
184-
)
181+
sender_kid = await self.default_sender_kid_for_did(resolver, frm) if frm else None
185182
sender_key = await secrets.get_secret_by_kid(sender_kid) if sender_kid else None
186183
if frm and not sender_key:
187184
raise PackagingServiceError("No sender key found")

didcomm_messaging/quickstart.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Quickstart helpers for beginner users of DIDComm."""
2+
23
from typing import (
34
Optional,
45
Dict,

0 commit comments

Comments
 (0)