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

Function get_for_url

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

Get the auth entry only if it was stored for the same `server_url`.

(mcp_name: &str, server_url: &str)

Source from the content-addressed store, hash-verified

88
89/// Get the auth entry only if it was stored for the same `server_url`.
90pub async fn get_for_url(mcp_name: &str, server_url: &str) -> Option<AuthEntry> {
91 let entry = get(mcp_name).await?;
92 match &entry.server_url {
93 Some(url) if url == server_url => Some(entry),
94 _ => None,
95 }
96}
97/// Persist an auth entry (optionally updating the server URL).
98pub async fn set(
99 mcp_name: &str,

Callers 4

refresh_tokenMethod · 0.85
get_tokenMethod · 0.85
has_stored_tokensMethod · 0.85
auth_statusMethod · 0.85

Calls 1

getFunction · 0.70

Tested by

no test coverage detected