Class: RosettAi::Mcp::HttpSecurityConfig::RateLimitConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/mcp/http_security_config.rb

Overview

Rate limiting sub-configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRateLimitConfig

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_rpmObject

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

#enabledObject

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_rpmObject

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