MCPcopy Create free account
hub / github.com/cactus-compute/cactus / get_api_key

Method get_api_key

python/src/config_utils.py:24–34  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 self.config_file.write_text(json.dumps(config, indent=2))
23
24 def get_api_key(self):
25 env_key = os.getenv("CACTUS_CLOUD_KEY")
26 if not env_key:
27 env_key = os.getenv("CACTUS_CLOUD_API_KEY")
28 if env_key:
29 return env_key
30 config = self.load_config()
31 config_key = config.get("api_key", "")
32 if config_key:
33 return config_key
34 return self.load_cached_api_key()
35
36 def cache_api_key(self, key):
37 if not key:

Callers 2

cmd_authFunction · 0.95
prompt_for_api_keyFunction · 0.80

Calls 3

load_configMethod · 0.95
load_cached_api_keyMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected