@zetra/citrineos-util 1.8.3-fork.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authorization/ApiAuthPlugin.d.ts +52 -0
- package/dist/authorization/ApiAuthPlugin.js +122 -0
- package/dist/authorization/ApiAuthPlugin.js.map +1 -0
- package/dist/authorization/OidcTokenProvider.d.ts +15 -0
- package/dist/authorization/OidcTokenProvider.js +47 -0
- package/dist/authorization/OidcTokenProvider.js.map +1 -0
- package/dist/authorization/index.d.ts +4 -0
- package/dist/authorization/index.js +8 -0
- package/dist/authorization/index.js.map +1 -0
- package/dist/authorization/provider/LocalByPassAuthProvider.d.ts +34 -0
- package/dist/authorization/provider/LocalByPassAuthProvider.js +62 -0
- package/dist/authorization/provider/LocalByPassAuthProvider.js.map +1 -0
- package/dist/authorization/provider/OIDCAuthProvider.d.ts +62 -0
- package/dist/authorization/provider/OIDCAuthProvider.js +173 -0
- package/dist/authorization/provider/OIDCAuthProvider.js.map +1 -0
- package/dist/authorization/rbac/RbacRulesLoader.d.ts +32 -0
- package/dist/authorization/rbac/RbacRulesLoader.js +105 -0
- package/dist/authorization/rbac/RbacRulesLoader.js.map +1 -0
- package/dist/authorization/rbac/UrlMatcher.d.ts +14 -0
- package/dist/authorization/rbac/UrlMatcher.js +44 -0
- package/dist/authorization/rbac/UrlMatcher.js.map +1 -0
- package/dist/authorizer/RealTimeAuthorizer.d.ts +28 -0
- package/dist/authorizer/RealTimeAuthorizer.js +152 -0
- package/dist/authorizer/RealTimeAuthorizer.js.map +1 -0
- package/dist/authorizer/index.d.ts +1 -0
- package/dist/authorizer/index.js +5 -0
- package/dist/authorizer/index.js.map +1 -0
- package/dist/cache/memory.d.ts +19 -0
- package/dist/cache/memory.js +147 -0
- package/dist/cache/memory.js.map +1 -0
- package/dist/cache/redis.d.ts +16 -0
- package/dist/cache/redis.js +120 -0
- package/dist/cache/redis.js.map +1 -0
- package/dist/certificate/CertificateAuthority.d.ts +38 -0
- package/dist/certificate/CertificateAuthority.js +233 -0
- package/dist/certificate/CertificateAuthority.js.map +1 -0
- package/dist/certificate/CertificateUtil.d.ts +60 -0
- package/dist/certificate/CertificateUtil.js +317 -0
- package/dist/certificate/CertificateUtil.js.map +1 -0
- package/dist/certificate/client/acme.d.ts +37 -0
- package/dist/certificate/client/acme.js +138 -0
- package/dist/certificate/client/acme.js.map +1 -0
- package/dist/certificate/client/hubject.d.ts +41 -0
- package/dist/certificate/client/hubject.js +221 -0
- package/dist/certificate/client/hubject.js.map +1 -0
- package/dist/certificate/client/interface.d.ts +12 -0
- package/dist/certificate/client/interface.js +5 -0
- package/dist/certificate/client/interface.js.map +1 -0
- package/dist/certificate/index.d.ts +2 -0
- package/dist/certificate/index.js +6 -0
- package/dist/certificate/index.js.map +1 -0
- package/dist/files/ftpServer.d.ts +4 -0
- package/dist/files/ftpServer.js +9 -0
- package/dist/files/ftpServer.js.map +1 -0
- package/dist/files/gcpCloudStorage.d.ts +39 -0
- package/dist/files/gcpCloudStorage.js +130 -0
- package/dist/files/gcpCloudStorage.js.map +1 -0
- package/dist/files/localStorage.d.ts +14 -0
- package/dist/files/localStorage.js +57 -0
- package/dist/files/localStorage.js.map +1 -0
- package/dist/files/s3Storage.d.ts +17 -0
- package/dist/files/s3Storage.js +118 -0
- package/dist/files/s3Storage.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/networkconnection/WebsocketNetworkConnection.d.ts +135 -0
- package/dist/networkconnection/WebsocketNetworkConnection.js +474 -0
- package/dist/networkconnection/WebsocketNetworkConnection.js.map +1 -0
- package/dist/networkconnection/authenticator/Authenticator.d.ts +20 -0
- package/dist/networkconnection/authenticator/Authenticator.js +39 -0
- package/dist/networkconnection/authenticator/Authenticator.js.map +1 -0
- package/dist/networkconnection/authenticator/AuthenticatorFilter.d.ts +11 -0
- package/dist/networkconnection/authenticator/AuthenticatorFilter.js +30 -0
- package/dist/networkconnection/authenticator/AuthenticatorFilter.js.map +1 -0
- package/dist/networkconnection/authenticator/BasicAuthenticationFilter.d.ts +17 -0
- package/dist/networkconnection/authenticator/BasicAuthenticationFilter.js +51 -0
- package/dist/networkconnection/authenticator/BasicAuthenticationFilter.js.map +1 -0
- package/dist/networkconnection/authenticator/ConnectedStationFilter.d.ts +14 -0
- package/dist/networkconnection/authenticator/ConnectedStationFilter.js +25 -0
- package/dist/networkconnection/authenticator/ConnectedStationFilter.js.map +1 -0
- package/dist/networkconnection/authenticator/NetworkProfileFilter.d.ts +16 -0
- package/dist/networkconnection/authenticator/NetworkProfileFilter.js +84 -0
- package/dist/networkconnection/authenticator/NetworkProfileFilter.js.map +1 -0
- package/dist/networkconnection/authenticator/UnknownStationFilter.d.ts +16 -0
- package/dist/networkconnection/authenticator/UnknownStationFilter.js +25 -0
- package/dist/networkconnection/authenticator/UnknownStationFilter.js.map +1 -0
- package/dist/networkconnection/authenticator/errors/AuthenticationError.d.ts +6 -0
- package/dist/networkconnection/authenticator/errors/AuthenticationError.js +25 -0
- package/dist/networkconnection/authenticator/errors/AuthenticationError.js.map +1 -0
- package/dist/networkconnection/authenticator/errors/IUpgradeError.d.ts +9 -0
- package/dist/networkconnection/authenticator/errors/IUpgradeError.js +5 -0
- package/dist/networkconnection/authenticator/errors/IUpgradeError.js.map +1 -0
- package/dist/networkconnection/authenticator/errors/UnknownError.d.ts +6 -0
- package/dist/networkconnection/authenticator/errors/UnknownError.js +24 -0
- package/dist/networkconnection/authenticator/errors/UnknownError.js.map +1 -0
- package/dist/networkconnection/index.d.ts +5 -0
- package/dist/networkconnection/index.js +9 -0
- package/dist/networkconnection/index.js.map +1 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/index.js +8 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/kafka/receiver.d.ts +35 -0
- package/dist/queue/kafka/receiver.js +179 -0
- package/dist/queue/kafka/receiver.js.map +1 -0
- package/dist/queue/kafka/sender.d.ts +53 -0
- package/dist/queue/kafka/sender.js +189 -0
- package/dist/queue/kafka/sender.js.map +1 -0
- package/dist/queue/rabbit-mq/receiver.d.ts +89 -0
- package/dist/queue/rabbit-mq/receiver.js +472 -0
- package/dist/queue/rabbit-mq/receiver.js.map +1 -0
- package/dist/queue/rabbit-mq/sender.d.ts +90 -0
- package/dist/queue/rabbit-mq/sender.js +251 -0
- package/dist/queue/rabbit-mq/sender.js.map +1 -0
- package/dist/security/SignedMeterValuesUtil.d.ts +44 -0
- package/dist/security/SignedMeterValuesUtil.js +135 -0
- package/dist/security/SignedMeterValuesUtil.js.map +1 -0
- package/dist/security/authentication.d.ts +2 -0
- package/dist/security/authentication.js +26 -0
- package/dist/security/authentication.js.map +1 -0
- package/dist/util/RequestOperations.d.ts +14 -0
- package/dist/util/RequestOperations.js +25 -0
- package/dist/util/RequestOperations.js.map +1 -0
- package/dist/util/StringOperations.d.ts +1 -0
- package/dist/util/StringOperations.js +8 -0
- package/dist/util/StringOperations.js.map +1 -0
- package/dist/util/emaidCheckDigitCalculator.d.ts +15 -0
- package/dist/util/emaidCheckDigitCalculator.js +179 -0
- package/dist/util/emaidCheckDigitCalculator.js.map +1 -0
- package/dist/util/idGenerator.d.ts +7 -0
- package/dist/util/idGenerator.js +10 -0
- package/dist/util/idGenerator.js.map +1 -0
- package/dist/util/parser.d.ts +31 -0
- package/dist/util/parser.js +60 -0
- package/dist/util/parser.js.map +1 -0
- package/dist/util/swagger.d.ts +5 -0
- package/dist/util/swagger.js +154 -0
- package/dist/util/swagger.js.map +1 -0
- package/dist/util/validator.d.ts +110 -0
- package/dist/util/validator.js +534 -0
- package/dist/util/validator.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { OCPP2_0_1 } from '@citrineos/base';
|
|
5
|
+
import { VariableAttribute } from '@citrineos/data';
|
|
6
|
+
import { Logger } from 'tslog';
|
|
7
|
+
import { calculateCheckDigit } from './emaidCheckDigitCalculator.js';
|
|
8
|
+
import { getNumberOfFractionDigit } from './parser.js';
|
|
9
|
+
/**
|
|
10
|
+
* Validate a language tag is an RFC-5646 tag, see: {@link https://tools.ietf.org/html/rfc5646},
|
|
11
|
+
* example: US English is: "en-US"
|
|
12
|
+
*
|
|
13
|
+
* @param languageTag
|
|
14
|
+
* @returns {boolean} true if the languageTag is an RFC-5646 tag
|
|
15
|
+
*/
|
|
16
|
+
export function validateLanguageTag(languageTag) {
|
|
17
|
+
if (!languageTag.trim()) {
|
|
18
|
+
console.log('Empty language tag');
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return /^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$/.test(languageTag);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validate constraints of ChargingProfileType defined in OCPP 2.0.1
|
|
25
|
+
*
|
|
26
|
+
* @param chargingProfileType ChargingProfileType from the request
|
|
27
|
+
* @param tenantId tenant id the profile belongs to
|
|
28
|
+
* @param stationId station id
|
|
29
|
+
* @param deviceModelRepository deviceModelRepository
|
|
30
|
+
* @param chargingProfileRepository chargingProfileRepository
|
|
31
|
+
* @param transactionEventRepository transactionEventRepository
|
|
32
|
+
* @param logger logger
|
|
33
|
+
* @param evseId evse id
|
|
34
|
+
*/
|
|
35
|
+
export async function validateChargingProfileType(chargingProfileType, tenantId, stationId, deviceModelRepository, chargingProfileRepository, transactionEventRepository, logger, evseId) {
|
|
36
|
+
if (chargingProfileType.stackLevel < 0) {
|
|
37
|
+
throw new Error('Lowest Stack level is 0');
|
|
38
|
+
}
|
|
39
|
+
if (chargingProfileType.chargingProfilePurpose ===
|
|
40
|
+
OCPP2_0_1.ChargingProfilePurposeEnumType.ChargingStationMaxProfile &&
|
|
41
|
+
evseId !== 0) {
|
|
42
|
+
throw new Error('When chargingProfilePurpose is ChargingStationMaxProfile, evseId SHALL be 0');
|
|
43
|
+
}
|
|
44
|
+
if (chargingProfileType.chargingProfilePurpose !==
|
|
45
|
+
OCPP2_0_1.ChargingProfilePurposeEnumType.TxProfile &&
|
|
46
|
+
chargingProfileType.transactionId) {
|
|
47
|
+
throw new Error('transactionId SHALL only be included when ChargingProfilePurpose is set to TxProfile.');
|
|
48
|
+
}
|
|
49
|
+
let receivedChargingNeeds;
|
|
50
|
+
if (chargingProfileType.transactionId && evseId) {
|
|
51
|
+
const transaction = await transactionEventRepository.readTransactionByStationIdAndTransactionId(tenantId, stationId, chargingProfileType.transactionId);
|
|
52
|
+
if (!transaction) {
|
|
53
|
+
throw new Error(`Transaction ${chargingProfileType.transactionId} not found on station ${stationId}.`);
|
|
54
|
+
}
|
|
55
|
+
const evse = await deviceModelRepository.findEvseByIdAndConnectorId(tenantId, evseId, null);
|
|
56
|
+
if (!evse) {
|
|
57
|
+
throw new Error(`Evse ${evseId} not found.`);
|
|
58
|
+
}
|
|
59
|
+
logger.info(`Found evse: ${JSON.stringify(evse)}`);
|
|
60
|
+
receivedChargingNeeds =
|
|
61
|
+
await chargingProfileRepository.findChargingNeedsByEvseDBIdAndTransactionDBId(tenantId, evse.databaseId, transaction.id);
|
|
62
|
+
logger.info(`Found ChargingNeeds: ${JSON.stringify(receivedChargingNeeds)}`);
|
|
63
|
+
}
|
|
64
|
+
const periodsPerSchedules = await deviceModelRepository.readAllByQuerystring(tenantId, {
|
|
65
|
+
tenantId: tenantId,
|
|
66
|
+
stationId: stationId,
|
|
67
|
+
component_name: 'SmartChargingCtrlr',
|
|
68
|
+
variable_name: 'PeriodsPerSchedule',
|
|
69
|
+
type: OCPP2_0_1.AttributeEnumType.Actual,
|
|
70
|
+
});
|
|
71
|
+
logger.info(`Found PeriodsPerSchedule: ${JSON.stringify(periodsPerSchedules)}`);
|
|
72
|
+
let periodsPerSchedule;
|
|
73
|
+
if (periodsPerSchedules.length > 0 && periodsPerSchedules[0].value) {
|
|
74
|
+
periodsPerSchedule = Number(periodsPerSchedules[0].value);
|
|
75
|
+
}
|
|
76
|
+
for (const chargingSchedule of chargingProfileType.chargingSchedule) {
|
|
77
|
+
if (chargingSchedule.minChargingRate &&
|
|
78
|
+
getNumberOfFractionDigit(chargingSchedule.minChargingRate) > 1) {
|
|
79
|
+
throw new Error(`chargingSchedule ${chargingSchedule.id}: minChargingRate accepts at most one digit fraction (e.g. 8.1).`);
|
|
80
|
+
}
|
|
81
|
+
if (periodsPerSchedule && chargingSchedule.chargingSchedulePeriod.length > periodsPerSchedule) {
|
|
82
|
+
throw new Error(`ChargingSchedule ${chargingSchedule.id}: The number of chargingSchedulePeriod SHALL not exceed ${periodsPerSchedule}.`);
|
|
83
|
+
}
|
|
84
|
+
for (const chargingSchedulePeriod of chargingSchedule.chargingSchedulePeriod) {
|
|
85
|
+
if (getNumberOfFractionDigit(chargingSchedulePeriod.limit) > 1) {
|
|
86
|
+
throw new Error(`ChargingSchedule ${chargingSchedule.id}: chargingSchedulePeriod limit accepts at most one digit fraction (e.g. 8.1).`);
|
|
87
|
+
}
|
|
88
|
+
if (receivedChargingNeeds) {
|
|
89
|
+
if (receivedChargingNeeds.acChargingParameters) {
|
|
90
|
+
// EV AC charging
|
|
91
|
+
if (!chargingSchedulePeriod.numberPhases) {
|
|
92
|
+
chargingSchedulePeriod.numberPhases = 3;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else if (receivedChargingNeeds.dcChargingParameters) {
|
|
96
|
+
// EV DC charging
|
|
97
|
+
chargingSchedulePeriod.numberPhases = undefined;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (chargingSchedule.salesTariff) {
|
|
102
|
+
if (receivedChargingNeeds &&
|
|
103
|
+
receivedChargingNeeds.maxScheduleTuples &&
|
|
104
|
+
chargingSchedule.salesTariff.salesTariffEntry.length >
|
|
105
|
+
receivedChargingNeeds.maxScheduleTuples) {
|
|
106
|
+
throw new Error(`ChargingSchedule ${chargingSchedule.id}: The number of SalesTariffEntry elements (${chargingSchedule.salesTariff.salesTariffEntry.length}) SHALL not exceed maxScheduleTuples (${receivedChargingNeeds.maxScheduleTuples}).`);
|
|
107
|
+
}
|
|
108
|
+
for (const salesTariffEntry of chargingSchedule.salesTariff.salesTariffEntry) {
|
|
109
|
+
if (salesTariffEntry.consumptionCost) {
|
|
110
|
+
for (const consumptionCost of salesTariffEntry.consumptionCost) {
|
|
111
|
+
if (consumptionCost.cost) {
|
|
112
|
+
for (const cost of consumptionCost.cost) {
|
|
113
|
+
if (cost.amountMultiplier &&
|
|
114
|
+
(cost.amountMultiplier > 3 || cost.amountMultiplier < -3)) {
|
|
115
|
+
throw new Error(`ChargingSchedule ${chargingSchedule.id}: amountMultiplier SHALL be in [-3, 3].`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Validate ISO15693 ID token format
|
|
127
|
+
* ISO 15693 UID should be exactly 8 bytes (16 hex characters)
|
|
128
|
+
*/
|
|
129
|
+
export function validateISO15693IdToken(idToken) {
|
|
130
|
+
return !!idToken && idToken.length === 16 && /^[0-9A-Fa-f]+$/.test(idToken);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Validate ISO14443 ID token format
|
|
134
|
+
* ISO 14443 UID should be 4 or 7 bytes (8 or 14 hex characters)
|
|
135
|
+
*/
|
|
136
|
+
export function validateISO14443IdToken(idToken) {
|
|
137
|
+
return (!!idToken && (idToken.length === 8 || idToken.length === 14) && /^[0-9A-Fa-f]+$/.test(idToken));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Validate identifier string format per OCPP 2.0.1. We expect this validation already from the JSON schema,
|
|
141
|
+
* but we add this extra validation to be sure.
|
|
142
|
+
* Only allows: a-z, A-Z, 0-9, *, -, _, =, :, +, |, @, .
|
|
143
|
+
*/
|
|
144
|
+
export function validateIdentifierStringIdToken(idToken) {
|
|
145
|
+
return !!idToken && /^[a-zA-Z0-9*\-_=:+|@.]+$/.test(idToken);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Validates an eMAID string according to eMI³ specifications
|
|
149
|
+
* @param emaid - The eMAID string to validate
|
|
150
|
+
* @returns errors - String array with errors, empty if valid
|
|
151
|
+
*/
|
|
152
|
+
export function validateEMAIDIdToken(emaid) {
|
|
153
|
+
const errors = [];
|
|
154
|
+
// Remove optional separators and convert to uppercase
|
|
155
|
+
const separator = '-';
|
|
156
|
+
let cleanedEmaid = emaid.replace(new RegExp(separator, 'g'), '').toUpperCase();
|
|
157
|
+
// For backwards compatibility with DIN SPEC 91286 and eMAIDs without ID type at position 6
|
|
158
|
+
if (cleanedEmaid.length === 13) {
|
|
159
|
+
// Insert id type 'C'
|
|
160
|
+
cleanedEmaid = cleanedEmaid.substring(0, 5) + 'C' + cleanedEmaid.substring(5);
|
|
161
|
+
}
|
|
162
|
+
else if (cleanedEmaid.length === 14 && cleanedEmaid.substring(5, 6) !== 'C') {
|
|
163
|
+
// Insert id type 'C' and prune check digit
|
|
164
|
+
cleanedEmaid = cleanedEmaid.substring(0, 5) + 'C' + cleanedEmaid.substring(5, 13);
|
|
165
|
+
}
|
|
166
|
+
// Check overall length (14 or 15 characters without separators)
|
|
167
|
+
if (cleanedEmaid.length < 14 || cleanedEmaid.length > 15) {
|
|
168
|
+
errors.push(`Invalid length: ${cleanedEmaid.length} characters (expected 14 or 15)`);
|
|
169
|
+
return errors;
|
|
170
|
+
}
|
|
171
|
+
// Validate character set (alphanumeric only)
|
|
172
|
+
if (!/^[A-Z0-9]+$/.test(cleanedEmaid)) {
|
|
173
|
+
errors.push('eMAID must contain only alphanumeric characters (and optional hyphens as separators)');
|
|
174
|
+
return errors;
|
|
175
|
+
}
|
|
176
|
+
// Parse components
|
|
177
|
+
const countryCode = cleanedEmaid.substring(0, 2);
|
|
178
|
+
const providerId = cleanedEmaid.substring(2, 5);
|
|
179
|
+
const idType = cleanedEmaid.substring(5, 6);
|
|
180
|
+
const instance = cleanedEmaid.substring(6, 14);
|
|
181
|
+
const checkDigit = cleanedEmaid.length === 15 ? cleanedEmaid.substring(14, 15) : undefined;
|
|
182
|
+
// Validate Country Code (2 letters)
|
|
183
|
+
if (!/^[A-Z]{2}$/.test(countryCode)) {
|
|
184
|
+
errors.push('Country code must be exactly 2 letters');
|
|
185
|
+
}
|
|
186
|
+
// Validate Provider ID (3 alphanumeric)
|
|
187
|
+
if (!/^[A-Z0-9]{3}$/.test(providerId)) {
|
|
188
|
+
errors.push('Provider ID must be exactly 3 alphanumeric characters');
|
|
189
|
+
}
|
|
190
|
+
// Validate ID Type (must be 'C' for Contract)
|
|
191
|
+
if (idType !== 'C') {
|
|
192
|
+
errors.push(`ID Type must be 'C' for Contract (found: '${idType}')`);
|
|
193
|
+
}
|
|
194
|
+
// Validate Instance (8 alphanumeric)
|
|
195
|
+
if (!/^[A-Z0-9]{8}$/.test(instance)) {
|
|
196
|
+
errors.push('Instance must be exactly 8 alphanumeric characters');
|
|
197
|
+
}
|
|
198
|
+
// If check digit is present, validate it
|
|
199
|
+
if (checkDigit !== undefined) {
|
|
200
|
+
try {
|
|
201
|
+
const calculatedCheckDigit = calculateCheckDigit(cleanedEmaid.substring(0, 14));
|
|
202
|
+
if (checkDigit !== calculatedCheckDigit) {
|
|
203
|
+
errors.push(`Invalid check digit: expected '${calculatedCheckDigit}', found '${checkDigit}'`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
errors.push(`Check digit calculation error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return errors;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Validate NoAuthorization ID token (should be empty)
|
|
214
|
+
*/
|
|
215
|
+
export function validateNoAuthorizationIdToken(idToken) {
|
|
216
|
+
return !idToken || idToken.length === 0;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* ID token validator - routes to appropriate validator based on type
|
|
220
|
+
* Returns validation result with detailed error message if invalid
|
|
221
|
+
*/
|
|
222
|
+
export function validateIdToken(idTokenType, idToken) {
|
|
223
|
+
switch (idTokenType) {
|
|
224
|
+
case OCPP2_0_1.IdTokenEnumType.ISO15693:
|
|
225
|
+
if (validateISO15693IdToken(idToken)) {
|
|
226
|
+
return { isValid: true };
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
isValid: false,
|
|
230
|
+
errorMessage: 'ISO15693 tokens must be exactly 16 hexadecimal characters (0-9, A-F)',
|
|
231
|
+
};
|
|
232
|
+
case OCPP2_0_1.IdTokenEnumType.ISO14443:
|
|
233
|
+
if (validateISO14443IdToken(idToken)) {
|
|
234
|
+
return { isValid: true };
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
isValid: false,
|
|
238
|
+
errorMessage: 'ISO14443 tokens must be either 8 or 14 hexadecimal characters (0-9, A-F)',
|
|
239
|
+
};
|
|
240
|
+
case OCPP2_0_1.IdTokenEnumType.NoAuthorization:
|
|
241
|
+
if (validateNoAuthorizationIdToken(idToken)) {
|
|
242
|
+
return { isValid: true };
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
isValid: false,
|
|
246
|
+
errorMessage: 'NoAuthorization tokens must be empty',
|
|
247
|
+
};
|
|
248
|
+
case OCPP2_0_1.IdTokenEnumType.KeyCode:
|
|
249
|
+
if (validateIdentifierStringIdToken(idToken)) {
|
|
250
|
+
return { isValid: true };
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
isValid: false,
|
|
254
|
+
errorMessage: 'KeyCode tokens must contain only letters, numbers, and characters: * - _ = : + | @ .',
|
|
255
|
+
};
|
|
256
|
+
case OCPP2_0_1.IdTokenEnumType.Local:
|
|
257
|
+
if (validateIdentifierStringIdToken(idToken)) {
|
|
258
|
+
return { isValid: true };
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
isValid: false,
|
|
262
|
+
errorMessage: 'Local tokens must contain only letters, numbers, and characters: * - _ = : + | @ .',
|
|
263
|
+
};
|
|
264
|
+
case OCPP2_0_1.IdTokenEnumType.MacAddress:
|
|
265
|
+
if (validateIdentifierStringIdToken(idToken)) {
|
|
266
|
+
return { isValid: true };
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
isValid: false,
|
|
270
|
+
errorMessage: 'MacAddress tokens must contain only letters, numbers, and characters: * - _ = : + | @ .',
|
|
271
|
+
};
|
|
272
|
+
case OCPP2_0_1.IdTokenEnumType.Central:
|
|
273
|
+
if (validateIdentifierStringIdToken(idToken)) {
|
|
274
|
+
return { isValid: true };
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
isValid: false,
|
|
278
|
+
errorMessage: 'Central tokens must contain only letters, numbers, and characters: * - _ = : + | @ .',
|
|
279
|
+
};
|
|
280
|
+
case OCPP2_0_1.IdTokenEnumType.eMAID: {
|
|
281
|
+
const errors = validateEMAIDIdToken(idToken);
|
|
282
|
+
if (errors.length === 0) {
|
|
283
|
+
return { isValid: true };
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
isValid: false,
|
|
287
|
+
errorMessage: 'eMAID tokens must follow the eMI3 format: ' + errors.join(', '),
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
default:
|
|
291
|
+
return {
|
|
292
|
+
isValid: true, // IdTokenType is already validated by JSON schema, so types not listed here are considered valid
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Validate ASCII content - only printable ASCII allowed (characters 32-126)
|
|
298
|
+
* @param content Content string to validate
|
|
299
|
+
* @returns {boolean} true if content contains only printable ASCII characters
|
|
300
|
+
*/
|
|
301
|
+
export function validateASCIIContent(content) {
|
|
302
|
+
if (!content)
|
|
303
|
+
return true; // Empty content is valid
|
|
304
|
+
// Printable ASCII: space (32) through tilde (126)
|
|
305
|
+
return /^[\x20-\x7E]*$/.test(content);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Validate HTML content - checks for basic HTML structure validity
|
|
309
|
+
* @param content Content string to validate
|
|
310
|
+
* @returns {boolean} true if content appears to be valid HTML
|
|
311
|
+
*/
|
|
312
|
+
export function validateHTMLContent(content) {
|
|
313
|
+
if (!content)
|
|
314
|
+
return true; // Empty content is valid
|
|
315
|
+
// Basic HTML validation: check for properly matched tags
|
|
316
|
+
// This is a simplified check - real HTML validation would require a full parser
|
|
317
|
+
const tagPattern = /<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/g;
|
|
318
|
+
const tags = [];
|
|
319
|
+
let hasTags = false;
|
|
320
|
+
let match;
|
|
321
|
+
while ((match = tagPattern.exec(content)) !== null) {
|
|
322
|
+
const tag = match[0];
|
|
323
|
+
const tagName = match[1].toLowerCase();
|
|
324
|
+
hasTags = true;
|
|
325
|
+
// Skip self-closing tags and void elements
|
|
326
|
+
const voidElements = [
|
|
327
|
+
'area',
|
|
328
|
+
'base',
|
|
329
|
+
'br',
|
|
330
|
+
'col',
|
|
331
|
+
'embed',
|
|
332
|
+
'hr',
|
|
333
|
+
'img',
|
|
334
|
+
'input',
|
|
335
|
+
'link',
|
|
336
|
+
'meta',
|
|
337
|
+
'param',
|
|
338
|
+
'source',
|
|
339
|
+
'track',
|
|
340
|
+
'wbr',
|
|
341
|
+
];
|
|
342
|
+
if (tag.endsWith('/>') || voidElements.includes(tagName)) {
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
if (tag.startsWith('</')) {
|
|
346
|
+
// Closing tag
|
|
347
|
+
if (tags.length === 0 || tags[tags.length - 1] !== tagName) {
|
|
348
|
+
return false; // Mismatched closing tag
|
|
349
|
+
}
|
|
350
|
+
tags.pop();
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
// Opening tag
|
|
354
|
+
tags.push(tagName);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (!hasTags)
|
|
358
|
+
return false; // No HTML tags found
|
|
359
|
+
// All tags should be closed
|
|
360
|
+
return tags.length === 0;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Validate URI content - checks if content is a valid URI
|
|
364
|
+
* @param content Content string to validate
|
|
365
|
+
* @returns {boolean} true if content is a valid URI
|
|
366
|
+
*/
|
|
367
|
+
export function validateURIContent(content) {
|
|
368
|
+
if (!content)
|
|
369
|
+
return false; // Empty URI is not valid
|
|
370
|
+
try {
|
|
371
|
+
// Try to parse as URL - will throw if invalid
|
|
372
|
+
new URL(content);
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
// If absolute URL parsing fails, check if it's a valid relative URI
|
|
377
|
+
// A relative URI should at least not contain invalid characters
|
|
378
|
+
// and should follow basic URI syntax
|
|
379
|
+
const uriPattern = /^[a-zA-Z][a-zA-Z0-9+.-]*:|^\/|^[a-zA-Z0-9._~:/?#[\]@!$&'()*+,;=-]+$/;
|
|
380
|
+
return uriPattern.test(content);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Validate UTF-8 content - in JavaScript, strings are already UTF-16 encoded
|
|
385
|
+
* This function checks for invalid surrogate pairs and control characters
|
|
386
|
+
* @param content Content string to validate
|
|
387
|
+
* @returns {boolean} true if content is valid UTF-8
|
|
388
|
+
*/
|
|
389
|
+
export function validateUTF8Content(content) {
|
|
390
|
+
if (!content)
|
|
391
|
+
return true; // Empty content is valid
|
|
392
|
+
// Check for unpaired surrogate characters which indicate invalid UTF-16/UTF-8
|
|
393
|
+
for (let i = 0; i < content.length; i++) {
|
|
394
|
+
const charCode = content.charCodeAt(i);
|
|
395
|
+
// Check for high surrogate without low surrogate
|
|
396
|
+
if (charCode >= 0xd800 && charCode <= 0xdbff) {
|
|
397
|
+
if (i + 1 >= content.length) {
|
|
398
|
+
return false; // High surrogate at end of string
|
|
399
|
+
}
|
|
400
|
+
const nextCharCode = content.charCodeAt(i + 1);
|
|
401
|
+
if (nextCharCode < 0xdc00 || nextCharCode > 0xdfff) {
|
|
402
|
+
return false; // High surrogate not followed by low surrogate
|
|
403
|
+
}
|
|
404
|
+
i++; // Skip the low surrogate
|
|
405
|
+
}
|
|
406
|
+
// Check for low surrogate without high surrogate
|
|
407
|
+
else if (charCode >= 0xdc00 && charCode <= 0xdfff) {
|
|
408
|
+
return false; // Low surrogate without preceding high surrogate
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Message content validator - routes to appropriate validator based on format
|
|
415
|
+
* Returns validation result with detailed error message if invalid
|
|
416
|
+
* @param format Message format type (ASCII, HTML, URI, UTF8)
|
|
417
|
+
* @param content Message content to validate
|
|
418
|
+
* @returns {ValidationResult} Validation result with error message if invalid
|
|
419
|
+
*/
|
|
420
|
+
export function validateMessageContent(format, content) {
|
|
421
|
+
switch (format) {
|
|
422
|
+
case OCPP2_0_1.MessageFormatEnumType.ASCII:
|
|
423
|
+
if (validateASCIIContent(content)) {
|
|
424
|
+
return { isValid: true };
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
isValid: false,
|
|
428
|
+
errorMessage: 'ASCII format requires content to contain only printable ASCII characters (space through tilde)',
|
|
429
|
+
};
|
|
430
|
+
case OCPP2_0_1.MessageFormatEnumType.HTML:
|
|
431
|
+
if (validateHTMLContent(content)) {
|
|
432
|
+
return { isValid: true };
|
|
433
|
+
}
|
|
434
|
+
return {
|
|
435
|
+
isValid: false,
|
|
436
|
+
errorMessage: 'HTML format requires properly matched opening and closing tags',
|
|
437
|
+
};
|
|
438
|
+
case OCPP2_0_1.MessageFormatEnumType.URI:
|
|
439
|
+
if (validateURIContent(content)) {
|
|
440
|
+
return { isValid: true };
|
|
441
|
+
}
|
|
442
|
+
return {
|
|
443
|
+
isValid: false,
|
|
444
|
+
errorMessage: 'URI format requires a valid URI that the Charging Station can download',
|
|
445
|
+
};
|
|
446
|
+
case OCPP2_0_1.MessageFormatEnumType.UTF8:
|
|
447
|
+
if (validateUTF8Content(content)) {
|
|
448
|
+
return { isValid: true };
|
|
449
|
+
}
|
|
450
|
+
return {
|
|
451
|
+
isValid: false,
|
|
452
|
+
errorMessage: 'UTF8 format requires valid UTF-8 encoded content without unpaired surrogate characters',
|
|
453
|
+
};
|
|
454
|
+
default:
|
|
455
|
+
return {
|
|
456
|
+
isValid: false,
|
|
457
|
+
errorMessage: `Unknown message format: ${format}`,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Validate a complete MessageContentType object
|
|
463
|
+
* Convenience function that validates both language tag (if present) and content against format
|
|
464
|
+
* @param messageContent MessageContentType object to validate
|
|
465
|
+
* @returns {ValidationResult} Validation result with error message if invalid
|
|
466
|
+
*/
|
|
467
|
+
export function validateMessageContentType(messageContent) {
|
|
468
|
+
// Validate language tag if present
|
|
469
|
+
if (messageContent.language != null && !validateLanguageTag(messageContent.language)) {
|
|
470
|
+
return {
|
|
471
|
+
isValid: false,
|
|
472
|
+
errorMessage: `Invalid language tag: ${messageContent.language}. Must be an RFC-5646 language tag (e.g., "en-US")`,
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
// Validate content against format
|
|
476
|
+
return validateMessageContent(messageContent.format, messageContent.content);
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Validate PEM-encoded Certificate Signing Request (CSR)
|
|
480
|
+
* According to RFC 2986, CSR must be PEM-encoded with proper headers and valid base64 content
|
|
481
|
+
* @param csr CSR string to validate
|
|
482
|
+
* @returns {ValidationResult} Validation result with error message if invalid
|
|
483
|
+
*/
|
|
484
|
+
export function validatePEMEncodedCSR(csr) {
|
|
485
|
+
if (!csr || !csr.trim()) {
|
|
486
|
+
return {
|
|
487
|
+
isValid: false,
|
|
488
|
+
errorMessage: 'CSR cannot be empty',
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
const trimmedCSR = csr.trim();
|
|
492
|
+
// Check for PEM headers
|
|
493
|
+
const beginHeader = '-----BEGIN CERTIFICATE REQUEST-----';
|
|
494
|
+
const endHeader = '-----END CERTIFICATE REQUEST-----';
|
|
495
|
+
if (!trimmedCSR.includes(beginHeader)) {
|
|
496
|
+
return {
|
|
497
|
+
isValid: false,
|
|
498
|
+
errorMessage: 'CSR must contain BEGIN CERTIFICATE REQUEST header',
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
if (!trimmedCSR.includes(endHeader)) {
|
|
502
|
+
return {
|
|
503
|
+
isValid: false,
|
|
504
|
+
errorMessage: 'CSR must contain END CERTIFICATE REQUEST header',
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
// Extract content between headers
|
|
508
|
+
const beginIndex = trimmedCSR.indexOf(beginHeader) + beginHeader.length;
|
|
509
|
+
const endIndex = trimmedCSR.indexOf(endHeader);
|
|
510
|
+
if (beginIndex >= endIndex) {
|
|
511
|
+
return {
|
|
512
|
+
isValid: false,
|
|
513
|
+
errorMessage: 'CSR headers are in wrong order',
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
const content = trimmedCSR.substring(beginIndex, endIndex).trim();
|
|
517
|
+
// Check that there's actual content
|
|
518
|
+
if (content.replace(/\s/g, '').length === 0) {
|
|
519
|
+
return {
|
|
520
|
+
isValid: false,
|
|
521
|
+
errorMessage: 'CSR content is empty',
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
// Validate base64 content (allows A-Z, a-z, 0-9, +, /, =, and whitespace)
|
|
525
|
+
const base64Pattern = /^[A-Za-z0-9+/=\s]+$/;
|
|
526
|
+
if (!base64Pattern.test(content)) {
|
|
527
|
+
return {
|
|
528
|
+
isValid: false,
|
|
529
|
+
errorMessage: 'CSR content contains invalid characters for base64 encoding',
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
return { isValid: true };
|
|
533
|
+
}
|
|
534
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/util/validator.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,4fAA4f,CAAC,IAAI,CACtgB,WAAW,CACZ,CAAC;AACJ,CAAC;AAED;;;;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E,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC;IACxE,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/C,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,gCAAgC;SAC/C,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IAElE,oCAAoC;IACpC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,sBAAsB;SACrC,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,MAAM,aAAa,GAAG,qBAAqB,CAAC;IAC5C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,6DAA6D;SAC5E,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zetra/citrineos-util",
|
|
3
|
+
"version": "1.8.3-fork.1",
|
|
4
|
+
"description": "The OCPP util module which supplies helpful utilities like cache and queue connectors, etc.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"prepublish": "npx eslint ./src",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ocpp",
|
|
17
|
+
"ocpp_v201"
|
|
18
|
+
],
|
|
19
|
+
"author": "S44",
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/amqplib": "0.10.2",
|
|
23
|
+
"@types/json-schema-faker": "0.5.4",
|
|
24
|
+
"@types/jsrsasign": "10.5.14"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@zetra/citrineos-base": "1.8.3-fork.1",
|
|
28
|
+
"@zetra/citrineos-data": "1.8.3-fork.1",
|
|
29
|
+
"@fastify/swagger": "9.4.0",
|
|
30
|
+
"@fastify/swagger-ui": "5.2.0",
|
|
31
|
+
"@google-cloud/storage": "7.18.0",
|
|
32
|
+
"@peculiar/webcrypto": "1.4.6",
|
|
33
|
+
"acme-client": "5.3.0",
|
|
34
|
+
"amqplib": "^0.10.7",
|
|
35
|
+
"aws-sdk": "^2.1692.0",
|
|
36
|
+
"class-transformer": "0.5.1",
|
|
37
|
+
"json-schema-faker": "^0.5.8",
|
|
38
|
+
"jsonwebtoken": "^9.0.2",
|
|
39
|
+
"jsrsasign": "11.0.0",
|
|
40
|
+
"jwks-rsa": "^3.2.0",
|
|
41
|
+
"kafkajs": "2.2.4",
|
|
42
|
+
"mqtt": "5.1.2",
|
|
43
|
+
"pkijs": "3.0.16",
|
|
44
|
+
"redis": "4.6.6"
|
|
45
|
+
}
|
|
46
|
+
}
|