MartenThrottle::Settings
Inherits Marten::Conf::Settings < Reference < Object
Configuration namespace for marten-throttle.
Accessed via Marten.settings.throttle. Per-route rules and path exclusions are declared
inside a #draw block; unmatched requests are throttled only when default_policy is set:
Marten.settings.throttle.default_policy = MartenThrottle::Policy.new(limit: 100, per: 1.minute)
Marten.settings.throttle.draw do
exclude "/health"
rule "login", "/login", limit: 5, per: 1.minute, methods: ["POST"]
end
Class methods
Instance methods
cache_namespace
Sourceclient_identifier
Sourceclient_identifier=(client_identifier : ClientIdentifier | Nil)
Sourceclock
Sourceclock=(clock : Clock)
Sourcedefault_policy
Sourcedefault_policy=(default_policy : Policy | Nil)
Sourcedefault_strategy
Sourcedefault_strategy=(default_strategy : StrategyName)
Sourcedraw
Sourceenabled?
Sourceexclude(matcher : PathMatcher::Matcher) : PathMatcher
Sourceexclusions
Sourcefail_open?
Sourceremote_address
Sourceremote_address=(remote_address : RemoteAddress | Nil)
Sourcerule(name : String, matcher : Rule::Matcher, limit : Int32, per : Time::Span, strategy : StrategyName = default_strategy, methods : Array(String) | Nil = nil, identifier : ClientIdentifier | Nil = nil) : Rule
Sourcerules
Sourceskip_if
Sourceskip_if=(skip_if : SkipPredicate | Nil)
Sourcetrust_forwarded_headers?
Source