Class: ActionMCP::Gateway
- Inherits:
-
Object
- Object
- ActionMCP::Gateway
- Defined in:
- lib/action_mcp/gateway.rb
Direct Known Subclasses
Constant Summary collapse
- ALLOWED_IDENTITY_KEYS =
Whitelist of allowed identity attribute names to prevent method shadowing and unauthorized attribute assignment. Extend this list if you use custom identifier names in your GatewayIdentifier implementations.
%w[user api_key jwt bearer token account session].freeze
Class Method Summary collapse
-
.identified_by(*klasses) ⇒ Object
pluck in one or many GatewayIdentifier classes.
- .identifier_classes ⇒ Object
Instance Method Summary collapse
-
#call ⇒ Object
called by your rack/websocket layer.
-
#initialize(request) ⇒ Gateway
constructor
A new instance of Gateway.
Constructor Details
#initialize(request) ⇒ Gateway
Returns a new instance of Gateway.
23 24 25 |
# File 'lib/action_mcp/gateway.rb', line 23 def initialize(request) @request = request end |
Class Method Details
.identified_by(*klasses) ⇒ Object
pluck in one or many GatewayIdentifier classes
14 15 16 |
# File 'lib/action_mcp/gateway.rb', line 14 def identified_by(*klasses) @identifier_classes = klasses.flatten end |
.identifier_classes ⇒ Object
18 19 20 |
# File 'lib/action_mcp/gateway.rb', line 18 def identifier_classes @identifier_classes || [] end |
Instance Method Details
#call ⇒ Object
called by your rack/websocket layer
28 29 30 31 32 33 |
# File 'lib/action_mcp/gateway.rb', line 28 def call identities = authenticate! assign_identities(identities) apply_profile_from_authentication(identities) self end |