crypto key update works
MODIFY
src/server/rest/v1/service/security/SettingSecurity.ts
src/server/rest/v1/service/security/SettingSecurity.ts
-import { AnalyticsSettingsType, AssetConnectionSetting, AssetConnectionType, AssetSettingsType, BillingSettingsType, ConcurRefundSetting, OcpiBusinessDetails, OcpiSetting, PricingSettingsType, RefundSettingsType, RoamingSettingsType, SettingDB, SettingDBContent, SettingLink, SimplePricingSetting, SmartChargingSettingsType } from '../../../../../types/Setting';
+import { AnalyticsSettingsType, AssetConnectionSetting, AssetConnectionType, AssetSettingsType, BillingSettingsType, ConcurRefundSetting, CryptoSettingsType, OcpiBusinessDetails, OcpiSetting, PricingSettingsType, RefundSettingsType, RoamingSettingsType, SettingDB, SettingDBContent, SettingLink, SimplePricingSetting, SmartChargingSettingsType } from '../../../../../types/Setting';
import { HttpSettingRequest, HttpSettingsRequest } from '../../../../../types/requests/HttpSettingRequest';
import Utils from '../../../../../utils/Utils';
@@ -186,6 +186,23 @@ export default class SettingSecurity {
settings.content.asset.connections.push(sanitizedConnection);
}
break;
+ case CryptoSettingsType.CRYPTO:
+ settings.content.crypto = {
+ key: sanitize(request.content.crypto.key),
+ keyProperties: {
+ blockCypher: sanitize(request.content.crypto.keyProperties?.blockCypher),
+ blockSize: sanitize(request.content.crypto.keyProperties?.blockSize),
+ operationMode: sanitize(request.content.crypto.keyProperties?.operationMode)
+ },
+ formerKey: sanitize(request.content.crypto.formerKey),
+ formerKeyProperties: {
+ blockCypher: sanitize(request.content.crypto.formerKeyProperties?.blockCypher),
+ blockSize: sanitize(request.content.crypto.formerKeyProperties?.blockSize),
+ operationMode: sanitize(request.content.crypto.formerKeyProperties?.operationMode)
+ },
+ migrationToBeDone: sanitize(request.content.crypto.migrationToBeDone)
+ };
+ break;
}
}
return settings;

MODIFY
src/types/Setting.ts
src/types/Setting.ts
@@ -261,4 +261,5 @@ export interface CryptoSetting {
keyProperties: CryptoKeyProperties;
formerKey?: string;
formerKeyProperties?: CryptoKeyProperties;
+ migrationToBeDone?: boolean;
}

crypto key update works