MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / load

Method load

crates/opencode-plugin/src/subprocess/auth.rs:122–141  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 7

oauth_callbackFunction · 0.45
plugin_auth_loadFunction · 0.45
load_plugin_auth_storeFunction · 0.45
has_custom_fetchMethod · 0.45
load_plugin_auth_storeFunction · 0.45
createFunction · 0.45
is_cancelledMethod · 0.45

Calls 3

auth_loadMethod · 0.80
providerMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected