Skip to content

Commit fa8e7c8

Browse files
committed
Fix: Linting tests did not pass:
1 parent a86da5f commit fa8e7c8

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

src/aleph/sdk/conf.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
from shutil import which
66
from typing import ClassVar, Dict, Optional, Union
77

8-
from pydantic_settings import BaseSettings
9-
108
from aleph_message.models import Chain
119
from aleph_message.models.execution.environment import HypervisorType
1210
from pydantic import BaseModel, ConfigDict, Field
11+
from pydantic_settings import BaseSettings
1312

1413
from aleph.sdk.types import ChainInfo
1514

@@ -142,12 +141,10 @@ class Settings(BaseSettings):
142141
DNS_PROGRAM_DOMAIN: ClassVar[str] = "program.public.aleph.sh"
143142
DNS_INSTANCE_DOMAIN: ClassVar[str] = "instance.public.aleph.sh"
144143
DNS_STATIC_DOMAIN: ClassVar[str] = "static.public.aleph.sh"
145-
DNS_RESOLVERS: ClassVar[str] = ["9.9.9.9", "1.1.1.1"]
144+
DNS_RESOLVERS: ClassVar[list[str]] = ["9.9.9.9", "1.1.1.1"]
146145

147146
model_config = ConfigDict(
148-
env_prefix="ALEPH_",
149-
case_sensitive=False,
150-
env_file=".env"
147+
env_prefix="ALEPH_", case_sensitive=False, env_file=".env"
151148
)
152149

153150

src/aleph/sdk/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
from uuid import UUID
2929
from zipfile import BadZipFile, ZipFile
3030

31-
from pydantic import BaseModel
32-
31+
import pydantic_core
3332
from aleph_message.models import ItemHash, MessageType
3433
from aleph_message.models.execution.program import Encoding
3534
from aleph_message.models.execution.volume import MachineVolume
3635
from cryptography.hazmat.backends import default_backend
3736
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
3837
from jwcrypto.jwa import JWA
39-
import pydantic_core
4038

4139
from aleph.sdk.conf import settings
4240
from aleph.sdk.types import GenericMessage, SEVInfo, SEVMeasurement

tests/unit/aleph_vm_authentication.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from eth_account.messages import encode_defunct
1414
from jwcrypto import jwk
1515
from jwcrypto.jwa import JWA
16-
from pydantic import BaseModel, ValidationError, model_validator, field_validator
16+
from pydantic import BaseModel, ValidationError, field_validator, model_validator
1717

1818
from aleph.sdk.utils import bytes_from_hex
1919

@@ -74,7 +74,7 @@ def payload_must_be_hex(cls, value: bytes) -> bytes:
7474
return bytes_from_hex(value.decode())
7575

7676
@model_validator(mode="after")
77-
def check_expiry(cls, values) -> Dict[str, bytes]:
77+
def check_expiry(cls, values: "SignedPubKeyHeader") -> "SignedPubKeyHeader":
7878
"""Check that the token has not expired"""
7979
payload: bytes = values.payload
8080
content = SignedPubKeyPayload.model_validate_json(payload)
@@ -86,8 +86,7 @@ def check_expiry(cls, values) -> Dict[str, bytes]:
8686
return values
8787

8888
@model_validator(mode="after")
89-
def check_signature(cls, values: Dict[str, bytes]) -> Dict[str, bytes]:
90-
"""Check that the signature is valid"""
89+
def check_signature(cls, values: "SignedPubKeyHeader") -> "SignedPubKeyHeader":
9190
signature: bytes = values.signature
9291
payload: bytes = values.payload
9392
content = SignedPubKeyPayload.model_validate_json(payload)

0 commit comments

Comments
 (0)