From: Jérôme Benoit Date: Sat, 21 Mar 2026 19:18:54 +0000 (+0100) Subject: fix(auth): replace phantom spec references in source code comments X-Git-Tag: v3.2~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d6e48eb6e7c4bea13fc5e64ebcae5dab8412d14c;p=e-mobility-charging-stations-simulator.git fix(auth): replace phantom spec references in source code comments - G03.FR.01 → remove (was Change Availability, not auth) - R10 → C10.FR.08 (cache expiration behavior) - R16, R5 → C10.FR.08 (TTL reset 'since last used') - R2 → C10.FR.07 (evict non-valid entries first) - R17 → C13.FR.01 (local auth list priority over cache) --- diff --git a/src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts b/src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts index b875570a..26cdd333 100644 --- a/src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts +++ b/src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts @@ -53,7 +53,7 @@ interface RateLimitStats { * - 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 @@ -187,7 +187,7 @@ export class InMemoryAuthCache implements AuthCache { 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) { @@ -203,7 +203,7 @@ export class InMemoryAuthCache implements AuthCache { 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) @@ -289,7 +289,7 @@ export class InMemoryAuthCache implements AuthCache { 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 @@ -420,7 +420,7 @@ export class InMemoryAuthCache implements AuthCache { 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 diff --git a/src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts b/src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts index 8bb4dceb..ff1cdb69 100644 --- a/src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts +++ b/src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts @@ -146,7 +146,7 @@ export class AuthComponentFactory { * @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 (