Class: MCPClient::Auth::OAuthProvider::MemoryStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp_client/auth/oauth_provider.rb

Overview

Simple in-memory storage for OAuth data

Instance Method Summary collapse

Constructor Details

#initializeMemoryStorage



568
569
570
571
572
573
574
# File 'lib/mcp_client/auth/oauth_provider.rb', line 568

def initialize
  @tokens = {}
  @client_infos = {}
   = {}
  @pkce_data = {}
  @state_data = {}
end

Instance Method Details

#delete_pkce(server_url) ⇒ Object



608
609
610
# File 'lib/mcp_client/auth/oauth_provider.rb', line 608

def delete_pkce(server_url)
  @pkce_data.delete(server_url)
end

#delete_state(server_url) ⇒ Object



620
621
622
# File 'lib/mcp_client/auth/oauth_provider.rb', line 620

def delete_state(server_url)
  @state_data.delete(server_url)
end

#get_client_info(server_url) ⇒ Object



584
585
586
# File 'lib/mcp_client/auth/oauth_provider.rb', line 584

def get_client_info(server_url)
  @client_infos[server_url]
end

#get_pkce(server_url) ⇒ Object



600
601
602
# File 'lib/mcp_client/auth/oauth_provider.rb', line 600

def get_pkce(server_url)
  @pkce_data[server_url]
end

#get_server_metadata(server_url) ⇒ Object



592
593
594
# File 'lib/mcp_client/auth/oauth_provider.rb', line 592

def (server_url)
  [server_url]
end

#get_state(server_url) ⇒ Object



612
613
614
# File 'lib/mcp_client/auth/oauth_provider.rb', line 612

def get_state(server_url)
  @state_data[server_url]
end

#get_token(server_url) ⇒ Object



576
577
578
# File 'lib/mcp_client/auth/oauth_provider.rb', line 576

def get_token(server_url)
  @tokens[server_url]
end

#set_client_info(server_url, client_info) ⇒ Object



588
589
590
# File 'lib/mcp_client/auth/oauth_provider.rb', line 588

def set_client_info(server_url, client_info)
  @client_infos[server_url] = client_info
end

#set_pkce(server_url, pkce) ⇒ Object



604
605
606
# File 'lib/mcp_client/auth/oauth_provider.rb', line 604

def set_pkce(server_url, pkce)
  @pkce_data[server_url] = pkce
end

#set_server_metadata(server_url, metadata) ⇒ Object



596
597
598
# File 'lib/mcp_client/auth/oauth_provider.rb', line 596

def (server_url, )
  [server_url] = 
end

#set_state(server_url, state) ⇒ Object



616
617
618
# File 'lib/mcp_client/auth/oauth_provider.rb', line 616

def set_state(server_url, state)
  @state_data[server_url] = state
end

#set_token(server_url, token) ⇒ Object



580
581
582
# File 'lib/mcp_client/auth/oauth_provider.rb', line 580

def set_token(server_url, token)
  @tokens[server_url] = token
end