cablelabs / lpwanserver

LPWAN Provisioning & Management Server
https://lpwanserver.com
Apache License 2.0
37 stars 11 forks source link

Move session management into network rest clients #279

Closed rhythnic closed 5 years ago

rhythnic commented 5 years ago

Each network has a rest client (except TTN, which needs to be created). Currently sessions are managed in the networkProtocols.js file, and passed to each network protocol method. It would be better to manage the session in the rest client because each network has different session requirements/strategies, and passing the session throughout the network protocol code get's really tedious.

When the REST clients are managing the sessions, we can import them into the tests and use the clients to reduce all the HTTP request boilerplate code. We could do that now, but we'd still have to manage sessions in the tests. Before using the clients in the tests, I think they should be enhanced to manage sessions.