From 773614fb4921f21196bddef9fd78145c6150611d Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 8 Oct 2025 13:58:07 +0200 Subject: [PATCH 1/2] Fix: Upgrade `aleph_message` version to `1.0.5`. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c148831c..3b2d3d16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dynamic = [ "version" ] dependencies = [ "aiohttp>=3.8.3", "aioresponses>=0.7.6", - "aleph-message>=1.0.4", + "aleph-message>=1.0.5", "aleph-superfluid>=0.3", "base58==2.1.1", # Needed now as default with _load_account changement "coincurve; python_version>='3.9'", From d42b274727e94165a498e8f3663deccf63a7c00f Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 8 Oct 2025 14:05:36 +0200 Subject: [PATCH 2/2] Fix: Solve model_validator signature with the proper one --- tests/unit/aleph_vm_authentication.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/unit/aleph_vm_authentication.py b/tests/unit/aleph_vm_authentication.py index c1710c16..d25b5177 100644 --- a/tests/unit/aleph_vm_authentication.py +++ b/tests/unit/aleph_vm_authentication.py @@ -16,6 +16,7 @@ from jwcrypto import jwk from jwcrypto.jwa import JWA from pydantic import BaseModel, ValidationError, field_validator, model_validator +from typing_extensions import Self from aleph.sdk.utils import bytes_from_hex @@ -76,28 +77,28 @@ def payload_must_be_hex(cls, value: bytes) -> bytes: return bytes_from_hex(value.decode()) @model_validator(mode="after") # type: ignore - def check_expiry(cls, values: SignedPubKeyHeader) -> SignedPubKeyHeader: + def check_expiry(self) -> Self: """Check that the token has not expired""" - payload: bytes = values.payload + payload: bytes = self.payload content = SignedPubKeyPayload.model_validate_json(payload) if not is_token_still_valid(content.expires): msg = "Token expired" raise ValueError(msg) - return values + return self @model_validator(mode="after") # type: ignore - def check_signature(cls, values: SignedPubKeyHeader) -> SignedPubKeyHeader: - signature: bytes = values.signature - payload: bytes = values.payload + def check_signature(self) -> Self: + signature: bytes = self.signature + payload: bytes = self.payload content = SignedPubKeyPayload.model_validate_json(payload) if not verify_wallet_signature(signature, payload.hex(), content.address): msg = "Invalid signature" raise ValueError(msg) - return values + return self @property def content(self) -> SignedPubKeyPayload: