Skip to content

Commit

Permalink
Merge branch 'dev' into tauquir/scenario-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaguin authored Oct 9, 2024
2 parents f603ccb + 668af28 commit be685a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/syft/src/syft/server/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

# stdlib
import hashlib
from typing import Any

# third party
Expand Down Expand Up @@ -58,6 +59,9 @@ class SyftSigningKey(SyftBaseModel):
def make_signing_key(cls, v: Any) -> Any:
return SigningKey(bytes.fromhex(v)) if isinstance(v, str) else v

def deterministic_hash(self) -> str:
return hashlib.sha256(self.signing_key._seed).hexdigest()

@property
def verify_key(self) -> SyftVerifyKey:
return SyftVerifyKey(verify_key=self.signing_key.verify_key)
Expand Down
4 changes: 4 additions & 0 deletions packages/syft/src/syft/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ def __init__(
skey = signing_key
self.signing_key = skey or SyftSigningKey.generate()

logger.critical(
f"Hash of the signing key '{self.signing_key.deterministic_hash()[:5]}...'"
)

self.association_request_auto_approval = association_request_auto_approval

consumer_type = (
Expand Down

0 comments on commit be685a1

Please sign in to comment.