Class: RosettAi::Mcp::HttpSecurityConfig::RateLimitConfig
- Inherits:
-
Object
- Object
- RosettAi::Mcp::HttpSecurityConfig::RateLimitConfig
- Defined in:
- lib/rosett_ai/mcp/http_security_config.rb
Overview
Rate limiting sub-configuration.
Instance Attribute Summary collapse
-
#authenticated_rpm ⇒ Object
Returns the value of attribute authenticated_rpm.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#unauthenticated_rpm ⇒ Object
Returns the value of attribute unauthenticated_rpm.
Instance Method Summary collapse
- #apply(hash) ⇒ Object
-
#initialize ⇒ RateLimitConfig
constructor
A new instance of RateLimitConfig.
Constructor Details
#initialize ⇒ RateLimitConfig
Returns a new instance of RateLimitConfig.
119 120 121 122 123 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 119 def initialize @enabled = true @unauthenticated_rpm = 60 @authenticated_rpm = 300 end |
Instance Attribute Details
#authenticated_rpm ⇒ Object
Returns the value of attribute authenticated_rpm.
117 118 119 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 117 def authenticated_rpm @authenticated_rpm end |
#enabled ⇒ Object
Returns the value of attribute enabled.
117 118 119 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 117 def enabled @enabled end |
#unauthenticated_rpm ⇒ Object
Returns the value of attribute unauthenticated_rpm.
117 118 119 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 117 def unauthenticated_rpm @unauthenticated_rpm end |
Instance Method Details
#apply(hash) ⇒ Object
125 126 127 128 129 130 131 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 125 def apply(hash) return unless hash.is_a?(Hash) @enabled = hash['enabled'] if hash.key?('enabled') @unauthenticated_rpm = hash['unauthenticated_rpm'] if hash['unauthenticated_rpm'] @authenticated_rpm = hash['authenticated_rpm'] if hash['authenticated_rpm'] end |