Skip to content

Commit 40343ea

Browse files
authored
Merge pull request #2584 from IABTechLab/swi-UID2-7235-revert-operator-key-preflight
Remove operator-key pre-flight check from startup validation
2 parents 472dc07 + d6af21f commit 40343ea

2 files changed

Lines changed: 0 additions & 168 deletions

File tree

scripts/confidential_compute.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ class UID2ServicesUnreachableError(ConfidentialComputeStartupError):
5151
def __init__(self, cls, ip=None):
5252
super().__init__(error_name=f"E06: {self.__class__.__name__}", provider=cls, extra_message=ip)
5353

54-
class OperatorKeyRejectedError(ConfidentialComputeStartupError):
55-
def __init__(self, cls):
56-
super().__init__(error_name=f"E07: {self.__class__.__name__}", provider=cls)
57-
5854
class OperatorKeyPermissionError(ConfidentialComputeStartupError):
5955
def __init__(self, cls, message = None):
6056
super().__init__(error_name=f"E08: {self.__class__.__name__}", provider=cls, extra_message=message)
@@ -102,30 +98,6 @@ def validate_connectivity() -> None:
10298
except Exception as e:
10399
raise UID2ServicesUnreachableError(self.__class__.__name__)
104100

105-
def validate_operator_key_with_core_service() -> None:
106-
"""Pre-flight check: verifies the operator key is accepted by the core service.
107-
POSTs to /attest with only the Authorization header; core returns 401 for an
108-
invalid key before it even inspects the attestation payload."""
109-
core_url = self.configs["core_base_url"]
110-
operator_key = self.configs.get("operator_key")
111-
try:
112-
response = requests.post(
113-
f"{core_url}/attest",
114-
headers={"Authorization": f"Bearer {operator_key}"},
115-
json={},
116-
timeout=5
117-
)
118-
if response.status_code == 401:
119-
logging.error(f"Operator key rejected by core service. Response: {response.text}")
120-
raise OperatorKeyRejectedError(self.__class__.__name__)
121-
logging.info(f"Operator key verified with core service (HTTP {response.status_code})")
122-
except OperatorKeyRejectedError:
123-
raise
124-
except (requests.ConnectionError, requests.Timeout) as e:
125-
logging.warning(f"Could not reach core service for key pre-verification: {e}")
126-
except Exception as e:
127-
logging.warning(f"Unexpected error during operator key pre-verification: {e}")
128-
129101
type_hints = get_type_hints(ConfidentialComputeConfig, include_extras=True)
130102
required_keys = [field for field, hint in type_hints.items() if "NotRequired" not in str(hint)]
131103
missing_keys = [key for key in required_keys if key not in self.configs or self.configs[key] == None]
@@ -143,7 +115,6 @@ def validate_operator_key_with_core_service() -> None:
143115
validate_url("optout_base_url", environment)
144116
validate_operator_key()
145117
validate_connectivity()
146-
validate_operator_key_with_core_service()
147118
logging.info("Completed static validation of confidential compute config values")
148119

149120
@abstractmethod

scripts/tests/test_confidential_compute.py

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)