From d4d65733e925dcc1b152eef88f3f03e6f25037c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 29 May 2023 19:48:20 +0200 Subject: [PATCH] fix: allow to set some x509 certificates in templates MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's relevant for public root CA Signed-off-by: Jérôme Benoit --- src/charging-station/SharedLRUCache.ts | 2 +- src/types/ChargingStationInfo.ts | 10 ---------- src/types/ChargingStationTemplate.ts | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) 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; }; -- 2.34.1