]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(auth): replace phantom spec references in source code comments
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 21 Mar 2026 19:18:54 +0000 (20:18 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 21 Mar 2026 19:18:54 +0000 (20:18 +0100)
- 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)

src/charging-station/ocpp/auth/cache/InMemoryAuthCache.ts
src/charging-station/ocpp/auth/factories/AuthComponentFactory.ts

index b875570a7f86d02e62a29964cdbefba610141da1..26cdd3330c93eae853e08c13e155dbf232903073 100644 (file)
@@ -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
 
index 8bb4dcebdff357f8055f3dfca05a5904db8b69b5..ff1cdb691b7284885c6d27691d997508153816bc 100644 (file)
@@ -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 (