ResolveAPIKeyEnv returns the environment-variable name that holds this endpoint's API key. When the endpoint sets APIKeyEnv explicitly that name is used; otherwise a stable name is derived from the endpoint name — e.g. the endpoint "omnillm" yields "OMNILLM_API_KEY". Tools that authenticate via an e
(e Endpoint, endpointName string)
| 106 | // endpoint "omnillm" yields "OMNILLM_API_KEY". Tools that authenticate via an |
| 107 | // env var reference (codex's env_key) use this name. |
| 108 | func ResolveAPIKeyEnv(e Endpoint, endpointName string) string { |
| 109 | if name := strings.TrimSpace(e.APIKeyEnv); name != "" { |
| 110 | return name |
| 111 | } |
| 112 | return deriveAPIKeyEnvName(endpointName) |
| 113 | } |
| 114 | |
| 115 | // deriveAPIKeyEnvName builds a valid env-var name from an endpoint name by |
| 116 | // upper-casing it, replacing any character that is not a letter or digit with |
no test coverage detected