MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / load_whitelist

Function load_whitelist

vmm/src/vmm-cli.py:1473–1489  ·  view source on GitHub ↗

Load the whitelist of trusted signers from a file. Returns: List of trusted Ethereum addresses

()

Source from the content-addressed store, hash-verified

1471
1472
1473def load_whitelist() -> List[str]:
1474 """Load the whitelist of trusted signers from a file.
1475
1476 Returns:
1477 List of trusted Ethereum addresses
1478
1479 """
1480 if not os.path.exists(DEFAULT_KMS_WHITELIST_PATH):
1481 os.makedirs(os.path.dirname(DEFAULT_KMS_WHITELIST_PATH), exist_ok=True)
1482 return []
1483
1484 try:
1485 with open(DEFAULT_KMS_WHITELIST_PATH, "r") as f:
1486 data = json.load(f)
1487 return data.get("trusted_signers", [])
1488 except (json.JSONDecodeError, FileNotFoundError):
1489 return []
1490
1491
1492def save_whitelist(whitelist: List[str]) -> None:

Callers 2

manage_kms_whitelistMethod · 0.85

Calls 2

loadMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected