* - Memory usage tracking
* - Comprehensive statistics
*
- * Security considerations (G03.FR.01):
+ * Security considerations:
* - Rate limiting prevents DoS attacks on auth endpoints
* - Cache expiration ensures stale auth data doesn't persist
* - Memory limits prevent memory exhaustion attacks
const now = Date.now()
if (now >= entry.expiresAt) {
this.stats.expired++
- // Transition to EXPIRED status instead of deleting (R10)
+ // Transition to EXPIRED status instead of deleting (C10.FR.08)
entry.result = { ...entry.result, status: AuthorizationStatus.EXPIRED }
// Apply absolute lifetime cap to expired-transition TTL refresh (default-TTL entries only)
if (!entry.hasExplicitTtl) {
return entry.result
}
- // Cache hit - update LRU order and reset TTL (R16, R5)
+ // Cache hit - update LRU order and reset TTL (C10.FR.08)
this.stats.hits++
this.lruOrder.set(identifier, now)
this.cache.delete(key)
this.lruOrder.delete(key)
} else {
- // First expiration — transition to EXPIRED status (consistent with get() R10 semantics)
+ // First expiration — transition to EXPIRED status (consistent with get() C10.FR.08 semantics)
entry.result = { ...entry.result, status: AuthorizationStatus.EXPIRED }
if (!entry.hasExplicitTtl) {
const absoluteDeadline = entry.createdAt + this.maxAbsoluteLifetimeMs
return
}
- // Phase 1 (R2): prefer evicting non-valid (status != ACCEPTED) entries
+ // Phase 1 (C10.FR.07): prefer evicting non-valid (status != ACCEPTED) entries
let candidateIdentifier: string | undefined
let candidateTime = Number.POSITIVE_INFINITY
* @param adapter - OCPP version-specific adapter
* @param cache - Authorization cache for storing remote auth results
* @param config - Authentication configuration controlling remote auth behavior
- * @param localAuthListManager - Optional local auth list manager for R17 cache exclusion
+ * @param localAuthListManager - Optional local auth list manager for C13.FR.01 cache exclusion
* @returns Remote strategy instance or undefined if remote auth disabled
*/
static async createRemoteStrategy (