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

Method default_status_for

crates/opencode-server/src/mcp_oauth.rs:528–552  ·  view source on GitHub ↗
(
        &self,
        server_name: &str,
        managed: &ManagedServer,
        oauth_status: Option<McpOAuthStatus>,
    )

Source from the content-addressed store, hash-verified

526 }
527
528 async fn default_status_for(
529 &self,
530 server_name: &str,
531 managed: &ManagedServer,
532 oauth_status: Option<McpOAuthStatus>,
533 ) -> McpServerInfo {
534 let oauth_required = managed.config.oauth_required();
535 let status = if !managed.enabled {
536 "disabled"
537 } else if oauth_required && oauth_status != Some(McpOAuthStatus::Authorized) {
538 "needs_auth"
539 } else {
540 "disabled"
541 };
542
543 McpServerInfo {
544 name: server_name.to_string(),
545 status: status.to_string(),
546 tools: 0,
547 resources: 0,
548 error: None,
549 oauth_required,
550 oauth_status,
551 }
552 }
553}
554
555impl Default for McpOAuthManager {

Callers 3

add_serverMethod · 0.80
get_serverMethod · 0.80
list_serversMethod · 0.80

Calls 1

oauth_requiredMethod · 0.80

Tested by

no test coverage detected