MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / set

Function set

crates/opencode-mcp/src/auth.rs:98–110  ·  view source on GitHub ↗

Persist an auth entry (optionally updating the server URL).

(
    mcp_name: &str,
    entry: AuthEntry,
    server_url: Option<&str>,
)

Source from the content-addressed store, hash-verified

96}
97/// Persist an auth entry (optionally updating the server URL).
98pub async fn set(
99 mcp_name: &str,
100 entry: AuthEntry,
101 server_url: Option<&str>,
102) -> Result<(), std::io::Error> {
103 let mut data = read_all().await;
104 let mut entry = entry;
105 if let Some(url) = server_url {
106 entry.server_url = Some(url.to_string());
107 }
108 data.insert(mcp_name.to_string(), entry);
109 write_all(&data).await
110}
111
112/// Remove all stored auth data for a server.
113pub async fn remove(mcp_name: &str) -> Result<(), std::io::Error> {

Callers 6

update_tokensFunction · 0.85
update_client_infoFunction · 0.85
update_code_verifierFunction · 0.85
clear_code_verifierFunction · 0.85
update_oauth_stateFunction · 0.85
clear_oauth_stateFunction · 0.85

Calls 2

read_allFunction · 0.85
write_allFunction · 0.85

Tested by

no test coverage detected