Skip to content

Commit 292641f

Browse files
use operator_key (#1333)
* use api_key if operator_key not present
1 parent 9850745 commit 292641f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/aws/ec2.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ def _set_confidential_config(self, secret_identifier: str) -> None:
9090
"""Fetches a secret value from AWS Secrets Manager and adds defaults"""
9191

9292
def add_defaults(configs: Dict[str, any]) -> AWSConfidentialComputeConfig:
93-
"""Adds default values to configuration if missing."""
93+
"""Adds default values to configuration if missing. Sets operator_key if only api_token is specified for backward compatibility """
9494
default_capacity = self.__get_max_capacity()
95+
configs.setdefault("operator_key", configs.get("api_token"))
9596
configs.setdefault("enclave_memory_mb", default_capacity["enclave_memory_mb"])
9697
configs.setdefault("enclave_cpu_count", default_capacity["enclave_cpu_count"])
9798
configs.setdefault("debug_mode", False)
98-
configs.setdefault("core_api_token", configs.get("api_token", ""))
99-
configs.setdefault("optout_api_token", configs.get("api_token", ""))
99+
configs.setdefault("core_api_token", configs.get("operator_key"))
100+
configs.setdefault("optout_api_token", configs.get("operator_key"))
100101
return configs
101102

102103
region = self.__get_current_region()
@@ -258,4 +259,4 @@ def __kill_auxiliaries(self) -> None:
258259
print("Failed starting up Confidential Compute. Please checks the logs for errors and retry \n", e)
259260
except Exception as e:
260261
print("Unexpected failure while starting up Confidential Compute. Please contact UID support team with this log \n ", e)
261-
262+

0 commit comments

Comments
 (0)