Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
olethanh committed Sep 30, 2024
1 parent 1081f84 commit 4b8abfb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/aleph/vm/orchestrator/views/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import json
import logging
from collections.abc import Awaitable, Callable, Coroutine
from typing import Any, Literal
from typing import Any, Literal, Union

import cryptography.exceptions
import pydantic
Expand All @@ -22,7 +22,7 @@
from jwcrypto import jwk
from jwcrypto.jwa import JWA
from nacl.exceptions import BadSignatureError
from pydantic import BaseModel, ValidationError, root_validator, validator
from pydantic import BaseModel, ValidationError, root_validator, validator, Field
from solathon.utils import verify_signature

from aleph.vm.conf import settings
Expand Down Expand Up @@ -58,7 +58,12 @@ class SignedPubKeyPayload(BaseModel):
# alg: Literal["ECDSA"]
address: str
expires: str
chain: Literal[Chain.SOL, Chain.ETH] = Chain.ETH
chain: Chain = Chain.ETH

def check_chain(self, v: Chain):
if v not in (Chain.ETH, Chain.SOL):
raise ValueError("Chain not supported")
return v

@property
def json_web_key(self) -> jwk.JWK:
Expand Down

0 comments on commit 4b8abfb

Please sign in to comment.