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

Function sync_custom_fetch_proxy

crates/opencode-server/src/server.rs:86–110  ·  view source on GitHub ↗
(
    provider_id: &str,
    bridge: Arc<PluginAuthBridge>,
    enabled: bool,
)

Source from the content-addressed store, hash-verified

84}
85
86pub(crate) fn sync_custom_fetch_proxy(
87 provider_id: &str,
88 bridge: Arc<PluginAuthBridge>,
89 enabled: bool,
90) {
91 if enabled {
92 register_custom_fetch_proxy(
93 provider_id.to_string(),
94 Arc::new(PluginBridgeFetchProxy {
95 bridge: bridge.clone(),
96 }),
97 );
98 if provider_id == "github-copilot" {
99 register_custom_fetch_proxy(
100 "github-copilot-enterprise",
101 Arc::new(PluginBridgeFetchProxy { bridge }),
102 );
103 }
104 } else {
105 unregister_custom_fetch_proxy(provider_id);
106 if provider_id == "github-copilot" {
107 unregister_custom_fetch_proxy("github-copilot-enterprise");
108 }
109 }
110}
111
112pub struct ServerState {
113 pub sessions: Mutex<SessionManager>,

Callers 2

oauth_callbackFunction · 0.85
load_plugin_auth_storeFunction · 0.85

Calls 4

newFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected