| 168 | |
| 169 | #[derive(Debug, thiserror::Error)] |
| 170 | pub enum AuthError { |
| 171 | #[error("OAuth pending request not found for provider: {0}")] |
| 172 | OauthMissing(String), |
| 173 | |
| 174 | #[error("OAuth authorization code missing for provider: {0}")] |
| 175 | OauthCodeMissing(String), |
| 176 | |
| 177 | #[error("OAuth callback failed")] |
| 178 | OauthCallbackFailed, |
| 179 | |
| 180 | #[error("API key not set for provider: {0}")] |
| 181 | ApiKeyNotSet(String), |
| 182 | } |
| 183 | |
| 184 | pub fn get_env_key(provider_id: &str) -> Option<String> { |
| 185 | let env_var = format!("{}_API_KEY", provider_id.to_uppercase().replace("-", "_")); |
nothing calls this directly
no outgoing calls
no test coverage detected