Class: RailsAiBridge::Config::Auth
- Inherits:
-
Object
- Object
- RailsAiBridge::Config::Auth
- Defined in:
- lib/rails_ai_bridge/config/auth.rb
Overview
Holds authentication and authorization settings for the MCP HTTP endpoint.
Strategy priority (highest → lowest):
- #mcp_jwt_decoder — caller-supplied JWT decoding lambda
- #mcp_token_resolver — caller-supplied token resolution lambda
- #http_mcp_token / +ENV["RAILS_AI_BRIDGE_MCP_TOKEN"]+ — static bearer token
- None configured — open access
Instance Attribute Summary collapse
-
#allow_auto_mount_in_production ⇒ Boolean
Allow auto-mounting the MCP endpoint in production.
-
#http_mcp_token ⇒ String?
Static bearer token for HTTP MCP auth.
-
#mcp_jwt_decoder ⇒ Proc?
Lambda decoding a raw JWT to a payload hash.
-
#mcp_token_resolver ⇒ Proc?
Lambda resolving a raw bearer token to an auth context.
Instance Method Summary collapse
-
#initialize ⇒ Auth
constructor
A new instance of Auth.
Constructor Details
#initialize ⇒ Auth
Returns a new instance of Auth.
27 28 29 30 31 32 |
# File 'lib/rails_ai_bridge/config/auth.rb', line 27 def initialize @http_mcp_token = nil @allow_auto_mount_in_production = false @mcp_token_resolver = nil @mcp_jwt_decoder = nil end |
Instance Attribute Details
#allow_auto_mount_in_production ⇒ Boolean
Returns allow auto-mounting the MCP endpoint in production.
19 20 21 |
# File 'lib/rails_ai_bridge/config/auth.rb', line 19 def allow_auto_mount_in_production @allow_auto_mount_in_production end |
#http_mcp_token ⇒ String?
Returns static bearer token for HTTP MCP auth.
16 17 18 |
# File 'lib/rails_ai_bridge/config/auth.rb', line 16 def http_mcp_token @http_mcp_token end |
#mcp_jwt_decoder ⇒ Proc?
Returns lambda decoding a raw JWT to a payload hash.
25 26 27 |
# File 'lib/rails_ai_bridge/config/auth.rb', line 25 def mcp_jwt_decoder @mcp_jwt_decoder end |
#mcp_token_resolver ⇒ Proc?
Returns lambda resolving a raw bearer token to an auth context.
22 23 24 |
# File 'lib/rails_ai_bridge/config/auth.rb', line 22 def mcp_token_resolver @mcp_token_resolver end |