Enforced token revoked check
Reject OCPP requests if the Charging Station has been manually made inactive
MODIFY
src/server/ocpp/utils/OCPPUtils.ts
src/server/ocpp/utils/OCPPUtils.ts
@@ -83,7 +83,16 @@ export default class OCPPUtils {
source: chargingStationID,
action,
module: MODULE_NAME, method: 'checkChargingStationConnectionToken',
- message: `Charging Station Token ID '${tokenID}' is expired, connection refused`,
+ message: `Charging Station Token ID '${tokenID}' has expired, connection refused`,
+ detailedMessages
+ });
+ }
+ if (token.revocationDate && moment().isAfter(token.revocationDate)) {
+ throw new BackendError({
+ source: chargingStationID,
+ action,
+ module: MODULE_NAME, method: 'checkChargingStationConnectionToken',
+ message: `Charging Station Token ID '${tokenID}' has been revoked, connection refused`,
detailedMessages
});
}
@@ -1527,7 +1536,16 @@ export default class OCPPUtils {
source: ocppHeader.chargeBoxIdentity,
module: MODULE_NAME,
method: 'checkAndGetTenantAndChargingStation',
- message: 'Charging Station is deleted'
+ message: 'Charging Station has been deleted'
+ });
+ }
+ // Inactive?
+ if (chargingStation?.forceInactive) {
+ throw new BackendError({
+ source: ocppHeader.chargeBoxIdentity,
+ module: MODULE_NAME,
+ method: 'checkAndGetTenantAndChargingStation',
+ message: 'Charging Station has been forced as inactive'
});
}
} catch (error) {

Enforced token revoked check
Reject OCPP requests if the Charging Station has been manually made inactive