mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 13:26:51 +00:00
call counter prefix
This commit is contained in:
parent
3e884478df
commit
5f5409e34a
@ -129,7 +129,7 @@ object Constant extends MdcLoggable {
|
||||
final val SHOW_USED_CONNECTOR_METHODS: Boolean = APIUtil.getPropsAsBoolValue(s"show_used_connector_methods", false)
|
||||
|
||||
// Rate Limiting Cache Prefixes
|
||||
final val CALL_COUNTER_PREFIX = "rl_counter_"
|
||||
final val CALL_COUNTER_PREFIX = "call_counter_"
|
||||
final val RATE_LIMIT_ACTIVE_PREFIX = "rl_active_"
|
||||
final val RATE_LIMIT_ACTIVE_CACHE_TTL: Int = APIUtil.getPropsValue("rateLimitActive.cache.ttl.seconds", "3600").toInt
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import code.ratelimiting.{RateLimiting, RateLimitingDI}
|
||||
import scala.concurrent.Future
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
import code.api.{APIFailureNewStyle, JedisMethod}
|
||||
import code.api.Constant._
|
||||
import code.api.cache.Redis
|
||||
import code.api.util.APIUtil.fullBoxOrException
|
||||
import code.api.util.ErrorMessages.TooManyRequests
|
||||
@ -192,7 +193,7 @@ object RateLimitingUtil extends MdcLoggable {
|
||||
|
||||
RateLimitCounterState(calls, normalizedTtl, status)
|
||||
}
|
||||
private def createUniqueKey(consumerKey: String, period: LimitCallPeriod) = "rl_counter_" + consumerKey + "_" + RateLimitingPeriod.toString(period)
|
||||
private def createUniqueKey(consumerKey: String, period: LimitCallPeriod) = CALL_COUNTER_PREFIX + consumerKey + "_" + RateLimitingPeriod.toString(period)
|
||||
private def underConsumerLimits(consumerKey: String, period: LimitCallPeriod, limit: Long): Boolean = {
|
||||
|
||||
if (useConsumerLimits) {
|
||||
|
||||
@ -1059,7 +1059,7 @@ trait APIMethods600 {
|
||||
CacheNamespacesJsonV600(
|
||||
namespaces = List(
|
||||
CacheNamespaceJsonV600(
|
||||
prefix = "rl_counter_",
|
||||
prefix = "call_counter_",
|
||||
description = "Rate limiting counters per consumer and time period",
|
||||
ttl_seconds = "varies",
|
||||
category = "Rate Limiting",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user