(
provider_id: &str,
bridge: Arc<PluginAuthBridge>,
enabled: bool,
)
| 84 | } |
| 85 | |
| 86 | pub(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 | |
| 112 | pub struct ServerState { |
| 113 | pub sessions: Mutex<SessionManager>, |
no test coverage detected