Giter VIP home page Giter VIP logo

sap-labs-france / ev-server Goto Github PK

View Code? Open in Web Editor NEW
136.0 21.0 131.0 47.66 MB

The Open e-Mobility Charging Station management backend server (check also ev-dashboard and ev-mobile)

Home Page: https://open-e-mobility.fr/

License: Apache License 2.0

JavaScript 0.41% Dockerfile 0.06% Shell 0.17% HTML 0.75% Makefile 0.12% TypeScript 98.49% Procfile 0.01% Batchfile 0.01%
e-mobility charge-point-operation mobility-operation

ev-server's Introduction

Open e-Mobility NodeJs Server

Summary

This application server (NodeJs) collects and stores the data (MongoDB) received from the Charging Stations via the OCPP protocol and exposes a REST service to an Angular front-end dashboard application (Open e-Mobility Angular Dashboard).

The application features:

  • Charging Stations details and real-time statuses
  • Charging sessions curves in real time
  • Charging stations remote control (Reboot, Clear Cache, Stop Transaction, Unlock Connector)
  • Charging Station Template management: Zero configuration
  • User management
  • Badge management
  • Role management (ABAC)
  • Static Energy Management: Manually limit the charging station
  • Smart Charging with Assets, Fair Sharing, Peak Shaving, Cost Management and Phase Balancing
  • Realtime Asset Management (Building, Battery, Solar Panel)
  • Billing with Stripe
  • Complex Pricing
  • Roaming integration (Gire, Hubject)
  • Refunding (SAP Concur)
  • Simple Statistics + Advanced Analytics (SAP Analytics)
  • Car Connector Management (Get the car's data to optimize the charging session)

Contact the author Serge FABIANO

Installation

  • Install NodeJS: https://nodejs.org/ (install the LTS version)
  • Install Python: https://www.python.org/ (needed by node-gyp)
  • Install MongoDB: https://www.mongodb.com/
  • Clone this GitHub project
  • Install required build tools:
    • Under Windows as an administrator:
      npm install --global --production windows-build-tools
    • Under Mac OS X, install Xcode from the Apple store
    • Under Debian based GNU/Linux distribution:
      sudo apt install build-essential
  • Go into the ev-server directory and run npm install or yarn install

NOTE:

choco install -y nodejs-lts mongodb python postman robot3t microsoft-build-tools
brew tap mongodb/brew
brew install node [email protected] [email protected] postman robo-3t
  • Follow the rest of the setup below

The Database

Start MongoDB

Manually
mongod --port <port> --dbpath <path> --replSet <replcaSetName>

For instance:

mongod --port 27017 --dbpath "/var/lib/mongodb" --replSet "rs0"
As a Windows service

Add to /path/to/mongod.cfg (open -a TextEdit /usr/local/etc/mongod.cfg)

...
replication:
  replSetName: "rs0"
...

Restart the MongoDB service with Powershell as an administrator:

Restart-Service -Name "MongoDB"

Activate the Replica Set

Activate the replica set:

  • Start the Mongo client
mongo
  • Activate the Replica Set
rs.initiate()

Check here for more info: Mongo DB Replica Set

Create the Admin user

This user will be used to connect to the database as an administrator with tools like MongoDB shell or RoboMongo:

Create Admin User on Admin schema:

  use admin
  db.createUser({
    user: "evse-admin",
    pwd: "<YourPassword>",
    roles: [
      "read",
      "readWrite",
      "dbAdmin",
      "userAdmin",
      "clusterAdmin",
      "readAnyDatabase",
      "readWriteAnyDatabase",
      "userAdminAnyDatabase",
      "dbAdminAnyDatabase"
    ],
    passwordDigestor: "server"
  })

Restart MongoDB with authentication enabled

Manually

This will restart MongoDB and will accept only authenticated connections from now:

mongod --auth --port <port> --dbpath <path> --replSet <replcaSetName>
As a Windows service

Add to /path/to/mongod.cfg:

...
security:
  authorization: enabled
...

Restart the MongoDB service with Powershell as an administrator:

Restart-Service -Name "MongoDB"

Create the Application User

Connect using the admin user

mongo -u evse-admin -p <YourPassword> --authenticationDatabase admin

Create Application User on EVSE schema

  use evse
  db.createUser({
    user: "evse-user",
    pwd: "<YourPassword>",
    roles: [
      "readWrite"
    ],
    passwordDigestor: "server"
  })

Now your database is ready to be used.

NOTE: You can also use empty-db.zip or empty-db-service.zip on the share to do the initial setup of the databases required by simply deleting all files in the MongoDB databases path and then dropping its content inside instead.

The Application Server

The application server consists of:

  • Central Service Server: Serves the charging stations
  • Central Service REST Server: Serves the Angular front-end dashboard

The Central Service Server (CSS)

This application server will listen to the charging stations and store the data exchanged into to the database.

It can also communicate with the charging stations (reboot, stop a transaction...)

The protocol used by this application server is OCPP (Open Charge Point Protocol) in version 1.2, 1.5 and 1.6 (OCPP-S or OCPP-J).

Other protocols, like the ISO 15118, or OCPP version 2.0 will also be supported in the future.

Configuration

In src/assets folder there are two templates already provided named config-template-http.json for HTTP and config-template-https.json for HTTPS.

Choose one and rename it to config.json.

Listen to the Charging Stations

Set the protocol, host and the port which you want the server to listen to:

SOAP (OCPP-S):

  "CentralSystems": [
    {
      "implementation": "soap",
      "protocol": "http",
      "host": "localhost",
      "port": 8000
    }
  ]

JSON (OCPP-J):

  "CentralSystems": [
    {
      "implementation": "json",
      "protocol": "ws",
      "host": "localhost",
      "port": 8010
    }
  ]

There can be several central systems with different protocols.

The Central Service REST Server (CSRS)

The server also exposes a set of REST services to serve the front-end Angular Dashboard.

This application displays the charging stations with their statuses, charging curves, user management...

To set the end point, fill the following information in the config.json file

Configuration

  "CentralSystemRestService": {
    "protocol": "http",
    "host": "YOUR_HOST",
    "port": 80,
		"userTokenKey": "YOUR_JWT_PRIVATE_KEY",
    "userTokenLifetimeHours": 12,
    "userDemoTokenLifetimeDays": 360,
    "userTechnicalTokenLifetimeDays": 180,
    "passwordWrongNumberOfTrial": 3,
    "passwordBlockedWaitTimeMin": 5,
    "captchaSecretKey": "YOUR_CAPTCHA_SECRET",
    "debug": false
  }

In order to properly call the REST endpoints, both ev-server and clients (ev-dashboard, ev-mobile, etc.) must reference a Google reCaptcha key. You can refer to this link https://www.google.com/recaptcha/admin/create, then copy the server key in config.json file, in section CentralSystemRestService:

    ...
    "captchaSecretKey": "<GOOGLE_RECAPTCHA_KEY_SERVER>"
    ...

Central Service Server (CSS) > Database

You have now to connect the server to the database.

Configuration

Database connection info:

  "Storage": {
    "implementation": "mongodb",
    "host": "localhost",
    "port": 27017,
    "user": "evse-user",
    "password": "YourPassword",
    "database" : "evse"
  }

Front-End

When the user will be notified (by email for instance), a link to the front-end application will be built based on the configuration below:

  "CentralSystemFrontEnd": {
    "protocol": "https",
    "host": "localhost",
    "port": 8080
  }

Notifications

The user will receive a notification when, for instance, his vehicle will be fully charged.

Only notification via emails is implemented today.

Email Notification

Edit the following info:

  "Email": {
    "smtp": {
      "from": "[email protected]",
      "host": "smtp.gmail.com",
      "port": 465,
      "secure": true,
      "requireTLS": true,
      "type": "login",
      "user": "YourEmailUser",
      "password": "YourEmailPassword",
      "debug": false
    }
  }

Users

Authentication

The authentication is done via user login/password and the server will deliver a token that will expire after a certain period of time.

Then there are neither session nor cookies sent around and this will allow to scale easily.

The token key is provided is the config.json file:

  "CentralSystemRestService": {
    ...
    "userTokenKey": "MySecureKeyToEncodeTokenAuth",
    "userTokenLifetimeHours": 12,
    "userDemoTokenLifetimeDays": 365,
    "userTechnicalTokenLifetimeDays": 365,
    ...
  }

You can set your own key to encode it in key userTokenKey and change its lifetime in userTokenLifetimeHours (12 hours by default.)

The Demo users can have a longer lifetime for demo purposes with key userDemoTokenLifetimeDays (365 days by default)

Authorization

The users can have differents roles:

  • SuperAdmin (S)
  • Admin (A)
  • Basic (B)
  • Demo (D)
Authorization Matrix
SuperAdmin Admin Basic Demo
Users List - -
User Create, Read, Update, Delete, Logout Read, Update (Only logged user), Logout (user hidden)
ChargingStations List List List
ChargingStation Read, Update, Delete, Reset, ClearCache, GetConfiguration, ChangeConfiguration, StopTransaction, UnlockConnector Read Read
Logging List List -
Tenant Create, Read, Update, Delete -

Notifications

The user will receive a notification when, for instance, his vehicle will be fully charged.

Email Notification

Set the following info:

  "Email": {
    "smtp": {
      "from": "[email protected]",
      "host": "smtp.gmail.com",
      "port": 465,
      "secure": true,
      "requireTLS": true,
      "type": "login",
      "user": "YourEmailUser",
      "password": "YourEmailPassword",
      "debug": false
    }
  }

Charging Station Parameters

Here are the charging station parameters:

  "ChargingStation": {
    "heartbeatIntervalSecs": 60,
    "checkEndOfChargeNotificationAfterMin": 5,
    "notifBeforeEndOfChargePercent": 50,
    "notifBeforeEndOfChargeEnabled": false,
    "notifEndOfChargePercent": 0,
    "notifEndOfChargeEnabled": true,
    "notifStopTransactionAndUnlockConnector": false
  },
  • heartbeatIntervalSecs: The time interval which the charging station will send the data to the server
  • checkEndOfChargeNotificationAfterMin: The delay to wait before the notification will be sent when the charge will be finished
  • notifBeforeEndOfChargePercent: The threshold for the intermediate notification (% of the energy delivered by the charging station)
  • notifBeforeEndOfChargeEnabled: Enable the intermediate notification
  • notifEndOfChargePercent: The threshold for the end of charge (% of the energy delivered by the charging station)
  • notifEndOfChargeEnabled: Enable the end of charge notification
  • notifStopTransactionAndUnlockConnector: Enable the stop transaction and unlock of the connector when the charge will be finished

Internationalization

Here are the default delivered locales:

  "Locales": {
    "default": "en_US",
    "supported": [
      "en_US",
      "fr_FR",
      "es_ES",
      "de_DE",
      "pt_PT",
      "it_IT",
    ]
  },

The Charging Stations

Each charging station vendor has its own configuration interface, so I'll just describe in general terms what's to be setup on those:

  • Set this server URL in the charging station's interface
  • Rename the charging station ID if necessary: this will be the key (use Company-Town-Number)
  • Set the charging station endpoint public URL to a reachable URL so the server can use it to trigger action on it (avoid using localhost)

All charging stations supporting OCPP-J and OCPP-S version 1.5 and 1.6 protocols are compatibles.

Start the Central Service Server (CSS)

Production Mode

Start the application:

npm run start

You can also start the application with the standard nodejs profiler:

npm run start:prod:prof

Development Mode

In a console, start the application (rebuild and restarts if any changes is detected):

npm run start:dev

You can also start the application with the standard nodejs profiler:

npm run start:dev:prof

Profiling with clinic

npm run start:(prod|dev):(doctorprof|flameprof|bubbleprof)

NOTE: You can also use the files in the ev-config-scripts.zip on the share to have a correct initial setup of your development environment and some server startup helpers.

Tests

Prerequisite: The database must contain an admin user.

  • Create a local configuration file located in './test/config/local.json' from the template file './test/config-template.json' with the parameters to override like
        {
          "superadmin": {
            "username": "YOUR_SUPERADMIN_USERNAME",
            "password": "YOUR_SUPERADMIN_PASSWORD"
          },
          "admin": {
            "username": "YOUR_ADMIN_USERNAME",
            "password": "YOUR_ADMIN_PASSWORD"
          },
          "server": {
            "logs": "json"
          },
          "ocpp": {
            "json": {
                "logs": "json"
            }
          }
        }

For further parameters, check the config content. It is also possible to use environment variables as defined in the config file

  • Start a server containing the configured admin user in the database
  • If you have not done it yet, run the command npm run test:createContext
  • Run the command npm run test

Docker Mode

Depending on the need it is possible to start different docker containers.

Each following command has to be executed in folder docker.

Minimal local environment

It consist in starting a pre configured empty mongo database plus a mail service and mongo express. To start it, execute command:

make local-env

To stop it, execute command:

make clean-local-env-containers

The mongo database folder will be kept along multiple restarts. To remove it:

make clean-mongo-data

Due to fixed replica set configuration, the database hostname has to be referenced in the host machine to be accessible. To enable it, as admin, add the entry ev_mongo 127.0.0.1 in /private/etc/hosts for MacOSX or in C:\Windows\System32\Drivers\etc\hosts for Windows.

The database is then accessible using the credential evse-admin/evse-admin-pwd. The default login/password on the master tenant is [email protected]/Super.admin00. The default login/password on the SLF tenant is [email protected]/Slf.admin00.

ev-server

In case of UI development or test purpose, the server has been containerized. To start it, execute command:

make server

In order to rebuild the image in case of changes:

make server-force

To stop it, execute command:

make clean-server-container

mongo express

If needed, it is possible to start or stop a mongo express instance auto connected to mongodb independently. To start it, execute command:

make mongo-express

To stop it, execute command:

make clean-mongo-express-container

All in one

It is possible to build and start all containers in one command:

make

Or without the optional git submodules:

make SUBMODULES_INIT=false

That Makefile option works for all targets.

Architecture

TAM Model

TAM Model

License

This file and all other files in this repository are licensed under the Apache Software License, v.2 and copyrighted under the copyright in NOTICE file, except as noted otherwise in the LICENSE file.

Please note that Docker images can contain other software which may be licensed under different licenses. This LICENSE and NOTICE files are also included in the Docker image. For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.

ev-server's People

Contributors

alixh avatar cabch avatar captaineaglex avatar changesbyjames avatar clauderossi avatar dependabot[bot] avatar fonsu avatar gochax avatar jakob8 avatar jerome-benoit avatar lmargaron avatar lucasbrazi06 avatar lucasbrazi666 avatar mahdibenromdhane avatar mariansalceda avatar melvyndubois avatar niklas-la avatar ninjeneer avatar olivegerste avatar ramzay avatar rmangin-fr avatar rohanantony avatar roiko avatar roxiciobotea210 avatar sebastien-savalle avatar sgarouachi avatar stefania-santimbrean avatar sweetsofia83 avatar vicyyn avatar willylellouch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ev-server's Issues

Perfs: Tests with 100, 1000, 10000, 100000 Charging Stations

  • Goal is to provide a report that we can show to the customers that contains:
  • Charger Connections with 100, 1000, 10000, 100000 (at once)
  • Charger Transactions with 100, 1000, 10000, 100000

Monitor the traffic/cpu/mem for each topic and generate charts so we can compare each load.

You can create a dedicated tenant in production so we can test real perfs and also the UI with this amount of data.

Try also to provide when creating the chargers, valid GPS coordinates so we can show them in SAC

Not defined parameters in ChargingStation

Found by eslint

C:\SAPDevelop\gitwork\chargeangels\ev-server\src\entity\ChargingStation.js
788:5 warning 'timeDiffDuration' is never reassigned. Use 'const' instead prefer-const
793:5 warning 'dateTimeString' is never reassigned. Use 'const' instead prefer-const
1483:82 error 'key' is not defined no-undef
1483:100 error 'value' is not defined no-undef

throw new BackendError(this.getID(), Cannot set the configuration param ${key} with value ${value} to ${this.getID()}, "ChargingStation", "requestChangeConfiguration")

This code is not correctly called in ChargingStationService line 427 with two parameters instead of one
result = await chargingStation.requestChangeConfiguration('maxintensitysocket', filteredRequest.maxIntensity);

Invalid ChargeBoxID returned in transaction

During a transaction, the returned ChargeBoxID is not the same as the one sent. In fact, it is an hexadecimal string representing it.

ChargeBoxID sent JX5HM5JMDHS9 to start a new transaction.
ChargeBoxID received 4a5835484d354a4d44485339 when reading the transaction from the server.

Remove check tenant API

Remove also the entry in the Rest API, the views (Tenant not found) and clean up the related components (guards...)

Login screen on the wrong tenant should return the message of the wrong login ('Wrong email or password') but should be logged correctly in the master tenant's logging ('User with email 'xyz' tried to log in with an unknown tenant 'xyz'!)

Impossible to create new Site

Description

impossible to create a new Site.

trace:

Company is not defined
at Function.company (/Users/i058319/devel/ev/ev-server/dist/webpack:/src/server/front-end/service/SiteService.js:211:1)
at SiteService (/Users/i058319/devel/ev/ev-server/dist/webpack:/src/server/front-end/CentralRestServerService.js:95:1)
at Layer.handle [as handle_request] (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:317:13)
at /Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:335:12)
at next (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:275:10)
at complete (/Users/i058319/devel/ev/ev-server/node_modules/passport/lib/middleware/authenticate.js:263:13)
at /Users/i058319/devel/ev/ev-server/node_modules/passport/lib/middleware/authenticate.js:270:15
at pass (/Users/i058319/devel/ev/ev-server/node_modules/passport/lib/authenticator.js:431:14)

The SiteService does not import the Company class.

Delete response contains the last created/updated ID

To reproduce:

  • run the test 'Should delete site which will delete the site area' in CompanySiteSiteAreaTest and observe the response data of a delete operation.

The issue is located here
Object.assign(Constants.REST_RESPONSE_SUCCESS, {id: newSite.getID()})

Documentation of the assign method:

/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;

Possible fix:
Object.assign({id: newSite.getID()}, Constants.REST_RESPONSE_SUCCESS)

{
  "method": "POST",
  "url": "/client/api/SiteAreaCreate",
  "data": {
    "siteID": "5bd08640f2244f598431c7fb",
    "name": "Dare LLC",
    "accessControl": true
  },
  "baseURL": "http://127.0.0.1:8082"
}
{
  "status": 200,
  "statusText": "OK",
  "data": {
    "status": "Success",
    "id": "5bd08640f2244f598431c7fd"
  }
}
{
  "method": "DELETE",
  "url": "/client/api/SiteDelete",
  "params": {
    "ID": "5bd08640f2244f598431c7fb"
  },
  "baseURL": "http://127.0.0.1:8082"
}
{
  "status": 200,
  "statusText": "OK",
  "data": {
    "status": "Success",
    "id": "5bd08640f2244f598431c7fd"
  }
}

Circular dependencies prevents starting a transaction

Issue Description

When running Transaction_test.js, the server failed with the following stacktrace:

TypeError: Site.getSite is not a function
    at SiteArea.getSite (/Users/i058319/devel/ev/ev-server/src/model/SiteArea.js:93:26)
    at Function.checkAndGetIfUserIsAuthorizedForChargingStation (/Users/i058319/devel/ev/ev-server/src/authorization/Authorizations.js:210:29)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Inspection

It appears that a cross dependency between Site and SiteArea forbids to use Site class inside SiteArea.
This issue is also present between the classes Site and User.

requestGetConfiguration called without params

in ChargingStation.js, the function requestGetConfiguration is called without providing params.

Running OCPPSoap15Test.js will pass but if you check the logs you can see:

{ source: undefined,
  module: undefined,
  method: undefined,
  action: 'RequestConfiguration',
  message: 'Cannot destructure property `keys` of \'undefined\' or \'null\'.',
  detailedMessages: 
   [ { stack: 'TypeError: Cannot destructure property `keys` of \'undefined\' or \'null\'.\n    at SoapChargingStationClient.getConfiguration (/Users/i058319/devel/ev/ev-server/src/client/soap/SoapChargingStationClient.js:236:22)\n    at ChargingStation.requestGetConfiguration (/Users/i058319/devel/ev/ev-server/src/model/ChargingStation.js:1357:46)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:189:7)' } ],
  type: 'S',
  level: 'E',
  timestamp: 2018-10-29T15:21:32.066Z }

Support multiple values in query parameters

In order to retrieve the logs from multiple users, the server must support query parameters with multi values. Several options are available:

  • Support operators like in, eq, gt, lt, ge, le (like userId=in(123,345))
  • Use a filter query param to support extended search (and, or) (like filter=(user eq 123 and site eq Caen) or (site eq Mougin)
  • Support the same query parameter several times (like userId=123&userId=456)
    ...

provide docker environment

For now, to run the ev-server, we need mongo installed and also a local mailserver available.

In order to ease this process and have the same environment for all developers we could use docker.

It should:

  • start a pre-configured database with users and passwords
  • start a mail server to receive notifications

Status:

  • docker database
  • docker mail server
  • provide default config file explained in readme.md
  • provide simple script to start/stop/reset the docker env explained in readme.md

Crash > Starting the backend on an empty database trigger a TypeError

(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hasOwnProperty' of undefined
    at Function._0x44d47c (/usr/app/dist/webpack:/src/utils/Logging.js:390:1)
    at Function.logInfo (/usr/app/dist/webpack:/src/utils/Logging.js:137:1)
    at Function.migrate (/usr/app/dist/webpack:/src/migration/MigrationHandler.js:23:1)
    at Function.start (/usr/app/dist/webpack:/src/start.js:63:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)

To reproduce, just create a docker image of the backend.

Security: Invalidate the token when user profile/component are changed

Scenario
On a enlevé le badge ID de Patrice pendant qu’il affichait le détail d’une borne.
Dans ce cas, on trigger un isAuthorize() dans le backend avec le badgeID qui est dans le token.
Comme le badge n’est plus dans la base ca va créer un ‘User Unknown’.

Solution
Il faut invalider le token d’un user à chaque fois qu’il est modifié par un admin.

Construire un hash qui serait dans le token et qui serait une concaténation des champs présents dans le profil du user (last update) et des components activés (Pricing...)
Si une de ces valeurs change on invalide le token cote backend.
Il faudrait donc une méthode qui construit ce hash et une autre qui le check de manière central a chaque requete qui requiert d'etre loggé.

Implement OCPP16-J

Implement server/charger communication over WebSocket and using JSON message format

Authorizations.switchTraceOn() is not a function

When I enabled the debug mode in config.json (Authorization) I got the error below;
After checking the code, unfortunately the method does not exist in branch master

{
    "_id" : ObjectId("5bbfb0d3d17f541a17019e5b"),
    "level" : "E",
    "source" : "Central Server",
    "type" : "S",
    "module" : null,
    "method" : null,
    "timestamp" : ISODate("2018-10-11T20:21:39.145Z"),
    "action" : "User",
    "message" : "Authorizations.switchTraceOn is not a function",
    "detailedMessages" : "[{\"stack\":\"TypeError: Authorizations.switchTraceOn is not a function\\n    at Function.canPerformAction (/home/mobile/Documents/charge-angel/ev-server/src/authorization/Authorizations.js:660:19)\\n    at Function.canReadUser (/home/mobile/Documents/charge-angel/ev-server/src/authorization/Authorizations.js:412:25)\\n    at Function.handleGetUser (/home/mobile/Documents/charge-angel/ev-server/src/server/front-end/service/UserService.js:362:24)\\n    at process._tickCallback (internal/process/next_tick.js:68:7)\"}]",
    "userID" : null,
    "actionOnUserID" : null
}

Create Variant Management

Implement new Variant management in the backend.

New collection in DB: variants
View ID (Logs, Chargers...)
User ID (optionel)
List of variants
Variant Name
List filters
Filter ID
Filter content

Implement Tenant

As discussed the whole topic below:

  • Add Super Admin (Type='S')
  • Add Namespace authorization (only SA can manage namespace)
  • Create Namespace view (List/Create/Edit/Delete) in the new dashboard
  • Use sub-domain to identify the namespace
  • Add namespace in login's token
  • Implement namespace in backend (get it from token and pass it up to the DB + prefix the collections)
  • Change URL of the charger to point to the right namespace
  • Migration / Switch to namespace
  • Doc to create a new namespace (Wiki? / Readme.md?)

impossible to update a user

when updating a user from the UI, the server always return an error mentioning that the phone is not valid. But the phone is valid. the regex checking it is not correct.

Auto activation of user account

Today new users are activated by an Admin during registration.
This process has to be done automatically via Auto Activation of email account.

ConnectorId 0 within handleStatusNotification

It is possible that the station sends a message with a connectorId = 0.
According to the standard it represents information about the charge point main controller.
Not sure what it means and how it should be handle. Anywa yit currently creates an error due to the fact that we try to access the array with connectorId-1.

new model of transactions ?

Could you let me know if a new transaction model has been introduced since d825e2b. After merging master branch, all my tests failed due to differences between expectations and actual transaction after getting them:

Before:

      {
        connectorId: connectorId,
        tagID: context.user.tagIDs[0],
        chargeBoxID: context.chargeBoxIdentity,
        chargeBox: {
          id: context.chargeBoxIdentity,
          connectors: [
            {
              activeTransactionID: transactionId,
              connectorId: connectorId,
              currentConsumption: 0,
              totalConsumption: 0,
              status: 'Available',
              errorCode: 'NoError',
              info: null,
              vendorErrorCode: null
            }
          ]
        }
      }

Now:

      {
        connectorId: connectorId,
        tagID: context.user.tagIDs[0],
        chargeBoxID: context.chargeBoxIdentity,
        id: transactionId,
        timestamp: currentTime.toISOString(),
        "user": {
          "firstName": context.user.firstName,
          "id": context.user.id,
          "name": context.user.name,
        }
      }

@LucasBrazi06, Is it a new model expected or is there an issue there ?

Allow to apply a configuration template to a charging station newly connected to a tenant.

During a load test against a tenant made with ev-simulator, unknown users and charging stations try to begin a charging session. To do so, users and charging station need to be manually 'attached' to the tenant.

  • For users, we can enable a tunable that will add any new user to the tenant as valid;
  • For charging stations, we need to have the same feature that will apply a configuration to each new station connected to avoid having to do manual configuration for load tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.