Class: RailsAiBridge::Mcp::Auth::BaseStrategy Abstract
- Inherits:
-
Object
- Object
- RailsAiBridge::Mcp::Auth::BaseStrategy
- Defined in:
- lib/rails_ai_bridge/mcp/auth/base_strategy.rb
Overview
This class is abstract.
Subclasses must implement +#authenticate(request) -> AuthResult+.
Shared helpers for Bearer-token–based auth strategies.
Direct Known Subclasses
Instance Method Summary collapse
-
#extract_bearer(request) ⇒ String?
Extracts the raw Bearer credential from an +Authorization+ header.
Instance Method Details
#extract_bearer(request) ⇒ String?
Extracts the raw Bearer credential from an +Authorization+ header.
14 15 16 17 18 19 20 |
# File 'lib/rails_ai_bridge/mcp/auth/base_strategy.rb', line 14 def extract_bearer(request) auth = request.get_header('HTTP_AUTHORIZATION') return nil if auth.blank? match = auth.match(/\ABearer\s+(.+)\z/i) match ? match[1].to_s.strip : nil end |