Add withAuth for ocpi endpoint
MODIFY
src/assets/server/rest/v1/schemas/ocpi/ocpi-endpoints-get.json
src/assets/server/rest/v1/schemas/ocpi/ocpi-endpoints-get.json
},
"ProjectFields": {
"$ref": "common#/definitions/projectFields"
+ },
+ "WithAuth": {
+ "$ref": "common#/definitions/withAuth",
+ "default": true
}
},
"required": [

MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -1194,7 +1194,7 @@ export default class AuthorizationService {
ocpiEndpoints.metadata = authorizationFilter.metadata;
// Add Authorizations
ocpiEndpoints.canCreate = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.OCPI_ENDPOINT, Action.CREATE, authorizationFilter, filteredRequest.Identifier ? { ID: filteredRequest.Identifier } : {});
+ tenant, userToken, Entity.OCPI_ENDPOINT, Action.CREATE, authorizationFilter, filteredRequest?.Identifier ? { ID: filteredRequest.Identifier } : {});
for (const ocpiEndpoint of ocpiEndpoints.result) {
await AuthorizationService.addOCPIEndpointAuthorizations(tenant, userToken, ocpiEndpoint, authorizationFilter);
}

Add withAuth for ocpi endpoint