Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log signing key #9327

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading