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) ⇒ void
Apply rate limit configuration from a hash.
-
#initialize ⇒ RateLimitConfig
constructor
A new instance of RateLimitConfig.
Constructor Details
#initialize ⇒ RateLimitConfig
Returns a new instance of RateLimitConfig.
133 134 135 136 137 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 133 def initialize @enabled = true @unauthenticated_rpm = 60 @authenticated_rpm = 300 end |
Instance Attribute Details
#authenticated_rpm ⇒ Object
Returns the value of attribute authenticated_rpm.
131 132 133 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 131 def authenticated_rpm @authenticated_rpm end |
#enabled ⇒ Object
Returns the value of attribute enabled.
131 132 133 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 131 def enabled @enabled end |
#unauthenticated_rpm ⇒ Object
Returns the value of attribute unauthenticated_rpm.
131 132 133 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 131 def unauthenticated_rpm @unauthenticated_rpm end |
Instance Method Details
#apply(hash) ⇒ void
This method returns an undefined value.
Apply rate limit configuration from a hash.
143 144 145 146 147 148 149 |
# File 'lib/rosett_ai/mcp/http_security_config.rb', line 143 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 |