From: Jérôme Benoit Date: Mon, 29 May 2023 17:48:20 +0000 (+0200) Subject: fix: allow to set some x509 certificates in templates X-Git-Tag: v1.2.15~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d4d65733e925dcc1b152eef88f3f03e6f25037c3;p=e-mobility-charging-stations-simulator.git fix: allow to set some x509 certificates in templates It's relevant for public root CA Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/SharedLRUCache.ts b/src/charging-station/SharedLRUCache.ts index f3d3274d..0d7a9dcc 100644 --- a/src/charging-station/SharedLRUCache.ts +++ b/src/charging-station/SharedLRUCache.ts @@ -1,4 +1,4 @@ -import { LRUCacheWithDelete as LRUCache } from 'mnemonist'; +import { LRUMapWithDelete as LRUCache } from 'mnemonist'; import { Bootstrap } from './Bootstrap'; import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types'; diff --git a/src/types/ChargingStationInfo.ts b/src/types/ChargingStationInfo.ts index fff8a1ad..2f9a07fc 100644 --- a/src/types/ChargingStationInfo.ts +++ b/src/types/ChargingStationInfo.ts @@ -1,15 +1,6 @@ import type { ChargingStationTemplate } from './ChargingStationTemplate'; import type { FirmwareStatus } from './ocpp/Requests'; -enum x509CertificateType { - V2GRootCertificate = 'V2GRootCertificate', - MORootCertificate = 'MORootCertificate', - CSMSRootCertificate = 'CSMSRootCertificate', - ManufacturerRootCertificate = 'ManufacturerRootCertificate', - ChargingStationCertificate = 'ChargingStationCertificate', - V2GCertificate = 'V2GCertificate', -} - export type ChargingStationInfo = Omit< ChargingStationTemplate, | 'AutomaticTransactionGenerator' @@ -32,7 +23,6 @@ export type ChargingStationInfo = Omit< maximumPower?: number; // Always in Watt maximumAmperage?: number; // Always in Ampere firmwareStatus?: FirmwareStatus; - x509Certificates?: Record; }; export type ChargingStationInfoConfiguration = { diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 0ba1899b..10f9733f 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -55,6 +55,15 @@ type CommandsSupport = { outgoingCommands?: Record; }; +enum x509CertificateType { + V2GRootCertificate = 'V2GRootCertificate', + MORootCertificate = 'MORootCertificate', + CSMSRootCertificate = 'CSMSRootCertificate', + ManufacturerRootCertificate = 'ManufacturerRootCertificate', + ChargingStationCertificate = 'ChargingStationCertificate', + V2GCertificate = 'V2GCertificate', +} + export type ChargingStationTemplate = { templateHash?: string; supervisionUrls?: string | string[]; @@ -116,4 +125,5 @@ export type ChargingStationTemplate = { AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration; Evses?: Record; Connectors?: Record; + x509Certificates?: Record; };