Load the auth provider configuration. This calls `auth.load` on the plugin, which may return an API key and/or indicate that a custom fetch proxy is available.
(&self)
| 120 | /// This calls `auth.load` on the plugin, which may return an API key |
| 121 | /// and/or indicate that a custom fetch proxy is available. |
| 122 | pub async fn load(&self) -> Result<PluginAuthLoadResult, PluginAuthError> { |
| 123 | let result = self.client.auth_load(self.provider()).await?; |
| 124 | |
| 125 | // Cache the API key |
| 126 | { |
| 127 | let mut cached = self.cached_api_key.write().await; |
| 128 | *cached = result.api_key.clone(); |
| 129 | } |
| 130 | |
| 131 | // Track custom fetch availability |
| 132 | self.has_custom_fetch.store( |
| 133 | result.has_custom_fetch, |
| 134 | std::sync::atomic::Ordering::Relaxed, |
| 135 | ); |
| 136 | |
| 137 | Ok(PluginAuthLoadResult { |
| 138 | api_key: result.api_key, |
| 139 | has_custom_fetch: result.has_custom_fetch, |
| 140 | }) |
| 141 | } |
| 142 | |
| 143 | // -- Fetch proxy -------------------------------------------------------- |
| 144 |
no test coverage detected