Endpoint cleanup
MODIFY
src/client/oicp/CpoOICPClient.ts
src/client/oicp/CpoOICPClient.ts
@@ -1248,16 +1248,6 @@ export default class CpoOICPClient extends OICPClient {
return response;
}
- public async triggerJobs(): Promise<{
- evses?: OICPResult,
- evseStatuses?: OICPResult;
- }> {
- return {
- evses: await this.sendEVSEs(),
- evseStatuses: await this.sendEVSEStatuses(),
- };
- }
-
// Get ChargeBoxIDs in failure from previous job
private getChargeBoxIDsInFailure(): string[] {
if (this.oicpEndpoint.lastPatchJobResult && this.oicpEndpoint.lastPatchJobResult.chargeBoxIDsInFailure) {

MODIFY
src/client/oicp/OICPClient.ts
src/client/oicp/OICPClient.ts
@@ -117,11 +117,6 @@ export default abstract class OICPClient {
return registerResult;
}
- public abstract triggerJobs(): Promise<{
- evses?: OICPResult,
- evseStatuses?: OICPResult;
- }>;
-
public abstract ping();
protected getEndpointUrl(service: string, action: ServerAction): string {

MODIFY
src/server/rest/CentralRestServerService.ts
src/server/rest/CentralRestServerService.ts
@@ -99,7 +99,6 @@ class RequestMapper {
[ServerAction.OCPI_ENPOINT_GENERATE_LOCAL_TOKEN]: OCPIEndpointService.handleGenerateLocalTokenOcpiEndpoint.bind(this),
[ServerAction.OICP_ENPOINT_CREATE]: OICPEndpointService.handleCreateOicpEndpoint.bind(this),
[ServerAction.OICP_ENPOINT_PING]: OICPEndpointService.handlePingOicpEndpoint.bind(this),
- [ServerAction.OICP_ENPOINT_TRIGGER_JOBS]: OICPEndpointService.handleTriggerJobsEndpoint.bind(this),
[ServerAction.OICP_ENPOINT_SEND_EVSE_STATUSES]: OICPEndpointService.handleSendEVSEStatusesOicpEndpoint.bind(this),
[ServerAction.OICP_ENPOINT_SEND_EVSES]: OICPEndpointService.handleSendEVSEsOicpEndpoint.bind(this),
[ServerAction.INTEGRATION_CONNECTION_CREATE]: ConnectionService.handleCreateConnection.bind(this),

MODIFY
src/server/rest/v1/service/OICPEndpointService.ts
src/server/rest/v1/service/OICPEndpointService.ts
@@ -23,7 +23,7 @@ import UtilsService from './UtilsService';
const MODULE_NAME = 'OICPEndpointService';
export default class OICPEndpointService {
- static async handleDeleteOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleDeleteOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
Action.DELETE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleDeleteOicpEndpoint');
@@ -41,14 +41,14 @@ export default class OICPEndpointService {
});
}
// Get
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.ID);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.ID);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.ID}' does not exist`,
MODULE_NAME, 'handleDeleteOicpEndpoint', req.user);
// Delete
- await OICPEndpointStorage.deleteOicpEndpoint(req.user.tenantID, oicpEndpoint.id);
+ await OICPEndpointStorage.deleteOicpEndpoint(req.tenant.id, oicpEndpoint.id);
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleDeleteOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' has been deleted successfully`,
action: action,
@@ -59,7 +59,10 @@ export default class OICPEndpointService {
next();
}
- static async handleCreateOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ public static async handleCreateOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ // Check if component is active
+ UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
+ Action.CREATE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleCreateOicpEndpoint');
// Check auth
if (!Authorizations.canCreateOicpEndpoint(req.user)) {
throw new AppAuthError({
@@ -92,10 +95,10 @@ export default class OICPEndpointService {
notifications: OICPEndpointPaths.NOTIFICATIONS
}
} as OICPEndpoint;
- const endpointID = await OICPEndpointStorage.saveOicpEndpoint(req.user.tenantID, oicpEndpoint);
+ const endpointID = await OICPEndpointStorage.saveOicpEndpoint(req.tenant.id, oicpEndpoint);
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleCreateOicpEndpoint',
message: `Oicp Endpoint '${filteredRequest.name}' has been created successfully`,
action: action,
@@ -106,7 +109,7 @@ export default class OICPEndpointService {
next();
}
- static async handleUpdateOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleUpdateOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
Action.UPDATE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleUpdateOicpEndpoint');
@@ -125,17 +128,17 @@ export default class OICPEndpointService {
});
}
// Get OicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleUpdateOicpEndpoint', req.user);
// Update timestamp
oicpEndpoint.lastChangedBy = { 'id': req.user.id };
oicpEndpoint.lastChangedOn = new Date();
// Update OicpEndpoint
- await OICPEndpointStorage.saveOicpEndpoint(req.user.tenantID, { ...oicpEndpoint, ...filteredRequest });
+ await OICPEndpointStorage.saveOicpEndpoint(req.tenant.id, { ...oicpEndpoint, ...filteredRequest });
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleUpdateOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' has been updated successfully`,
action: action,
@@ -146,7 +149,7 @@ export default class OICPEndpointService {
next();
}
- static async handleGetOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleGetOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
Action.READ, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleGetOicpEndpoint');
@@ -164,7 +167,7 @@ export default class OICPEndpointService {
});
}
// Get it
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, endpointID,
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, endpointID,
[
'id', 'name', 'role', 'baseUrl', 'countryCode', 'partyId', 'version', 'status', 'patchJobStatus', 'localToken', 'token',
'patchJobResult.successNbr', 'patchJobResult.failureNbr', 'patchJobResult.totalNbr'
@@ -175,7 +178,7 @@ export default class OICPEndpointService {
next();
}
- static async handleGetOicpEndpoints(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleGetOicpEndpoints(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
Action.LIST, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleGetOicpEndpoints');
@@ -196,7 +199,7 @@ export default class OICPEndpointService {
// Filter
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointsRequest(req.query);
// Get all oicpendpoints
- const oicpEndpoints = await OICPEndpointStorage.getOicpEndpoints(req.user.tenantID,
+ const oicpEndpoints = await OICPEndpointStorage.getOicpEndpoints(req.tenant.id,
{
'search': filteredRequest.Search
}, {
@@ -215,7 +218,10 @@ export default class OICPEndpointService {
next();
}
- static async handleSendEVSEStatusesOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ public static async handleSendEVSEStatusesOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ // Check if component is active
+ UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
+ Action.READ, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleSendEVSEStatusesOicpEndpoint');
// Check auth
if (!Authorizations.canTriggerJobOicpEndpoint(req.user)) {
throw new AppAuthError({
@@ -231,12 +237,11 @@ export default class OICPEndpointService {
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointSendEVSEStatusesRequest(req.body);
UtilsService.assertIdIsProvided(action, filteredRequest.id, MODULE_NAME, 'handleSendEVSEStatusesOicpEndpoint', req.user);
// Get oicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleSendEVSEStatusesOicpEndpoint', req.user);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
// Build OICP Client
- const oicpClient = await OICPClientFactory.getCpoOicpClient(tenant, oicpEndpoint);
+ const oicpClient = await OICPClientFactory.getCpoOicpClient(req.tenant, oicpEndpoint);
// Send EVSE statuses
const sendResult = await oicpClient.sendEVSEStatuses();
// Return result
@@ -244,7 +249,10 @@ export default class OICPEndpointService {
next();
}
- static async handleSendEVSEsOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ public static async handleSendEVSEsOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ // Check if component is active
+ UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
+ Action.READ, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleSendEVSEsOicpEndpoint');
// Check auth
if (!Authorizations.canTriggerJobOicpEndpoint(req.user)) {
throw new AppAuthError({
@@ -260,12 +268,11 @@ export default class OICPEndpointService {
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointSendEVSEsRequest(req.body);
UtilsService.assertIdIsProvided(action, filteredRequest.id, MODULE_NAME, 'handleSendEVSEsOicpEndpoint', req.user);
// Get oicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleSendEVSEsOicpEndpoint', req.user);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
// Build OICP Client
- const oicpClient = await OICPClientFactory.getCpoOicpClient(tenant, oicpEndpoint);
+ const oicpClient = await OICPClientFactory.getCpoOicpClient(req.tenant, oicpEndpoint);
// Send EVSE statuses
const sendResult = await oicpClient.sendEVSEs();
// Return result
@@ -273,36 +280,10 @@ export default class OICPEndpointService {
next();
}
- static async handleTriggerJobsEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
- // Check auth
- if (!Authorizations.canTriggerJobOicpEndpoint(req.user)) {
- throw new AppAuthError({
- errorCode: HTTPAuthError.ERROR,
- user: req.user,
- action: Action.TRIGGER_JOB,
- entity: Entity.OICP_ENDPOINT,
- module: MODULE_NAME,
- method: 'handleTriggerJobsEndpoint'
- });
- }
- // Filter
- const filteredRequest = OICPEndpointSecurity.filterOicpEndpointTriggerJobRequest(req.body);
- UtilsService.assertIdIsProvided(action, filteredRequest.id, MODULE_NAME, 'handleTriggerJobsEndpoint', req.user);
- // Get oicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
- UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
- MODULE_NAME, 'handleTriggerJobsEndpoint', req.user);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
- // Build OICP Client
- const oicpClient = await OICPClientFactory.getOicpClient(tenant, oicpEndpoint);
- // Send EVSE statuses
- const result = await oicpClient.triggerJobs();
- // Return result
- res.json(result);
- next();
- }
-
- static async handlePingOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ public static async handlePingOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction) {
+ // Check if component is active
+ UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
+ Action.UPDATE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handlePingOicpEndpoint');
// Check auth
if (!Authorizations.canPingOicpEndpoint(req.user)) {
throw new AppAuthError({
@@ -318,18 +299,17 @@ export default class OICPEndpointService {
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointPingRequest(req.body);
// Check Mandatory fields
UtilsService.checkIfOICPEndpointValid(filteredRequest, req);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
// Get oicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
// Build OICP Client
- const oicpClient = await OICPClientFactory.getOicpClient(tenant, oicpEndpoint);
+ const oicpClient = await OICPClientFactory.getOicpClient(req.tenant, oicpEndpoint);
// Try to ping
const pingResult = await oicpClient.ping();
// Check ping result
if (pingResult.statusCode === OICPStatusCode.Code000) {
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handlePingOicpEndpoint',
message: `Oicp Endpoint '${filteredRequest.name}' can be reached successfully`,
action: action,
@@ -339,7 +319,7 @@ export default class OICPEndpointService {
} else {
// Log
Logging.logSecurityError({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handlePingOicpEndpoint',
message: `Oicp Endpoint '${filteredRequest.name}' cannot be reached`,
action: action,
@@ -350,10 +330,10 @@ export default class OICPEndpointService {
next();
}
- static async handleUnregisterOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleUnregisterOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
- Action.READ, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleUnregisterOicpEndpoint');
+ Action.UPDATE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleUnregisterOicpEndpoint');
// Check auth
if (!Authorizations.canRegisterOicpEndpoint(req.user)) {
throw new AppAuthError({
@@ -367,19 +347,18 @@ export default class OICPEndpointService {
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRegisterRequest(req.body);
UtilsService.assertIdIsProvided(action, filteredRequest.id, MODULE_NAME, 'handleUnregisterOicpEndpoint', req.user);
// Get OicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleUnregisterOicpEndpoint', req.user);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
// Build OICP Client
- const oicpClient = await OICPClientFactory.getOicpClient(tenant, oicpEndpoint);
+ const oicpClient = await OICPClientFactory.getOicpClient(req.tenant, oicpEndpoint);
// Try to unregister
const result = await oicpClient.unregister();
// Check ping result
if (result.statusCode === StatusCodes.OK) {
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleUnregisterOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' can be reached successfully`,
action: action,
@@ -389,7 +368,7 @@ export default class OICPEndpointService {
} else {
// Log
Logging.logSecurityError({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleUnregisterOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' cannot be reached`,
action: action,
@@ -400,7 +379,7 @@ export default class OICPEndpointService {
next();
}
- static async handleRegisterOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
+ public static async handleRegisterOicpEndpoint(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check if component is active
UtilsService.assertComponentIsActiveFromToken(req.user, TenantComponents.OICP,
Action.UPDATE, Entity.OICP_ENDPOINT, MODULE_NAME, 'handleRegisterOicpEndpoint');
@@ -417,19 +396,18 @@ export default class OICPEndpointService {
const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRegisterRequest(req.body);
UtilsService.assertIdIsProvided(action, filteredRequest.id, MODULE_NAME, 'handleRegisterOicpEndpoint', req.user);
// Get OicpEndpoint
- const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.user.tenantID, filteredRequest.id);
+ const oicpEndpoint = await OICPEndpointStorage.getOicpEndpoint(req.tenant.id, filteredRequest.id);
UtilsService.assertObjectExists(action, oicpEndpoint, `OICPEndpoint with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleRegisterOicpEndpoint', req.user);
- const tenant = await TenantStorage.getTenant(req.user.tenantID);
// Build OICP Client
- const oicpClient = await OICPClientFactory.getOicpClient(tenant, oicpEndpoint);
+ const oicpClient = await OICPClientFactory.getOicpClient(req.tenant, oicpEndpoint);
// Try to register
const result = await oicpClient.register();
// Check ping result
if (result.statusCode === StatusCodes.OK) {
// Log
Logging.logSecurityInfo({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleRegisterOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' can be reached successfully`,
action: action,
@@ -439,7 +417,7 @@ export default class OICPEndpointService {
} else {
// Log
Logging.logSecurityError({
- tenantID: req.user.tenantID,
+ tenantID: req.tenant.id,
user: req.user, module: MODULE_NAME, method: 'handleRegisterOicpEndpoint',
message: `Oicp Endpoint '${oicpEndpoint.name}' cannot be reached`,
action: action,

MODIFY
src/server/rest/v1/service/security/OICPEndpointSecurity.ts
src/server/rest/v1/service/security/OICPEndpointSecurity.ts
@@ -16,54 +16,55 @@ export default class OICPEndpointSecurity {
}
static filterOicpEndpointUpdateRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
static filterOicpEndpointCreateRequest(request: any): Partial<OICPEndpoint> {
- return OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ return OICPEndpointSecurity.filterOicpEndpointRequest(request);
}
- public static filterOicpEndpointsRequest(request: any): HttpOICPEndpointsRequest {
- const filteredRequest: HttpOICPEndpointsRequest = {} as HttpOICPEndpointsRequest;
- filteredRequest.Search = sanitize(request.Search);
+ public static filterOicpEndpointsRequest(request: any): Partial<HttpOICPEndpointsRequest> {
+ const filteredRequest: Partial<HttpOICPEndpointsRequest> = {
+ Search: sanitize(request.Search)
+ };
UtilsSecurity.filterSkipAndLimit(request, filteredRequest);
UtilsSecurity.filterSort(request, filteredRequest);
return filteredRequest;
}
static filterOicpEndpointPingRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
static filterOicpEndpointTriggerJobRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
static filterOicpEndpointSendEVSEStatusesRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
static filterOicpEndpointSendEVSEsRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
static filterOicpEndpointRegisterRequest(request: any): Partial<OICPEndpoint> {
- const filteredRequest = OICPEndpointSecurity._filterOicpEndpointRequest(request);
+ const filteredRequest = OICPEndpointSecurity.filterOicpEndpointRequest(request);
filteredRequest.id = sanitize(request.id);
return filteredRequest;
}
- static _filterOicpEndpointRequest(request: any): Partial<OICPEndpoint> {
+ private static filterOicpEndpointRequest(request: any): Partial<OICPEndpoint> {
const filteredRequest: Partial<OICPEndpoint> = {};
filteredRequest.name = sanitize(request.name);
filteredRequest.role = sanitize(request.role);

MODIFY
src/server/rest/v1/service/security/SettingSecurity.ts
src/server/rest/v1/service/security/SettingSecurity.ts
@@ -39,7 +39,7 @@ export default class SettingSecurity {
return SettingSecurity._filterSettingRequest(request);
}
- public static _filterSettingRequest(request: Partial<SettingDB>): Partial<SettingDB> {
+ private static _filterSettingRequest(request: Partial<SettingDB>): Partial<SettingDB> {
const settings: SettingDB = {
identifier: sanitize(request.identifier),
sensitiveData: request.sensitiveData ? request.sensitiveData.map(sanitize) : []

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -155,7 +155,6 @@ export enum ServerAction {
OICP_SETTINGS = 'OicpSettings',
OICP_ENPOINT_CREATE = 'OicpEndpointCreate',
OICP_ENPOINT_PING = 'OicpEndpointPing',
- OICP_ENPOINT_TRIGGER_JOBS = 'OicpEndpointTriggerJobs',
OICP_ENDPOINT = 'OicpEndpoint',
OICP_ENDPOINTS = 'OicpEndpoints',
OICP_ENDPOINT_START = 'OicpEndpointStart',

Endpoint cleanup