Class: McpToolkit::Gateway::UpstreamRegistry::Upstream
- Inherits:
-
Data
- Object
- Data
- McpToolkit::Gateway::UpstreamRegistry::Upstream
- Defined in:
- lib/mcp_toolkit/gateway/upstream_registry.rb
Overview
public_tool_list is the gateway-cache contract: an upstream's tools/list
MUST be caller-INDEPENDENT (the same public tools for every valid token; scope
is enforced only when a tool is CALLED). That invariant is what lets the
Aggregator share one cache entry per upstream across all callers. An upstream
that filters its list by the caller's privilege (e.g. hides superuser-only
tools) breaks it and MUST register public_tool_list: false, which opts it out
of the shared cache so a privileged caller's list can't leak to an
unprivileged one. Default true — the overwhelming common case.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#public_tool_list ⇒ Object
readonly
Returns the value of attribute public_tool_list.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(key:, url:, public_tool_list: true) ⇒ Upstream
constructor
A new instance of Upstream.
- #name_for(tool_name) ⇒ Object
Constructor Details
#initialize(key:, url:, public_tool_list: true) ⇒ Upstream
Returns a new instance of Upstream.
32 33 34 |
# File 'lib/mcp_toolkit/gateway/upstream_registry.rb', line 32 def initialize(key:, url:, public_tool_list: true) super end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key
31 32 33 |
# File 'lib/mcp_toolkit/gateway/upstream_registry.rb', line 31 def key @key end |
#public_tool_list ⇒ Object (readonly)
Returns the value of attribute public_tool_list
31 32 33 |
# File 'lib/mcp_toolkit/gateway/upstream_registry.rb', line 31 def public_tool_list @public_tool_list end |
#url ⇒ Object (readonly)
Returns the value of attribute url
31 32 33 |
# File 'lib/mcp_toolkit/gateway/upstream_registry.rb', line 31 def url @url end |
Instance Method Details
#name_for(tool_name) ⇒ Object
36 37 38 |
# File 'lib/mcp_toolkit/gateway/upstream_registry.rb', line 36 def name_for(tool_name) "#{key}#{NAMESPACE_SEPARATOR}#{tool_name}" end |