Commit Graph
33 Commits
Author SHA1 Message Date
Sulka HaroandGitHub 914ba78f36 Security improvement batch (#6622)
* Adds a new method for the server to push notifies to the client, which require administration privileges from the user. If there are messages in queue but user is not privileged, she is notified of pending messages

* Fix unit tests

* Increase timeouts on tests

* Add translations

* * Aggregate admin messages
* Send admin message on auth fail
* Sending messages over bus
* XSS filtering of objects sent over the REST API

* Warn users if their instance is world readable

* Fix adminnotifies init()

* Fix couple issues from Codacy
2021-01-07 22:46:55 +02:00
Sulka Haro 0c7e9bf456 * Require created_at for Treatments on insert
* Refactoring the cache: moved to another file and support flushing from bus events
2020-09-19 18:17:20 +03:00
Sulka HaroandGitHub 801900597a Optimize Nightscout database usage (#5947)
* On periodic polls, only load delta for CGM data, treatments and device statuses
* Serve basic CGM data API queries from in-memory cache. Increases the Nightscout memory footprint but should significantly reduce the Mongo load
* Serve device status, CGM and treatment records from memory cache
* Support count parameter in /profile
2020-09-09 20:11:57 +03:00
JakobandSulka Haro 3a1d9be89d Fix eslint errors and add npm script for eslint (#5427)
* re-enable auth check for device status routes

* Resolve eslint errors

* Add npm script for eslint

* Correct regex for express extension middleware and add tests for expected behaviour

* Resolve lint error in virtual assistant base

* Update index.js

* Update index.js
2020-01-14 15:33:56 +00:00
JakobandSulka Haro 7dc292e056 Resolve unnecessary uses of eslint-ignore (#5436)
* Resolve unnecessary disabling of no-undef eslint rule

* Resolve unnecessary disabling of no-prototype-builtins eslint rule

* Resolve unnecessary disabling of no-unused-vars eslint rule

* Resolve unnecessary disabling of no-empty eslint rule
2020-01-12 20:13:29 +00:00
Sulka HaroandGitHub 35c7dc42ce * Allow users to set DE_NORMALIZE_DATES=false to have the REST API denormalize UTC dates to zoned ISO dates in the API (#4826) 2019-07-29 17:21:05 +03:00
Jeremy Cunningham 7a01c40929 Removed unused function. 2018-12-07 17:40:04 -06:00
Jeremy Cunningham af3e01a2e7 Match devicestatus api indention 2018-12-07 17:39:11 -06:00
Jeremy Cunningham d1b5c56d18 initialize query find by id correctly for devicestatus delete 2018-12-07 17:39:11 -06:00
Jeremy Cunningham 41d9d8a409 No 'model' concept for devicestatus 2018-12-07 17:39:11 -06:00
Jeremy Cunningham 71efc5e52f Fix devicestatus delete query handling 2018-12-07 17:39:11 -06:00
Jeremy Cunningham 44baf2e98c Add isId to api/devicestatus 2018-12-07 17:39:11 -06:00
Jeremy Cunningham 769b66ad7c cleanup devicestatus delete 2018-12-07 17:39:11 -06:00
Jeremy Cunningham ff043944eb Make devicestatus delete consistent with entries 2018-12-07 17:39:11 -06:00
Jeremy Cunningham 4405ba8846 Remove max days to keep limit in devicestatus delete.
Remove unused count query option in devicestatus delete api.

(cherry picked from commit 3101a8d7d054df469071f78bba18a8295dc34404)
2018-08-25 09:42:06 -05:00
Jeremy Cunningham 91a8135e45 Fixed 2018-08-08 23:03:55 -05:00
Jeremy Cunningham 8e84d116b4 Cleaned up code in api/devicestatus/index.js 2018-08-08 22:56:04 -05:00
Jeremy Cunningham bc99e63015 Fixed delete devicestatus by id. 2018-08-08 22:29:16 -05:00
Jeremy Cunningham bf72ccd7e9 Debug. 2018-08-08 21:55:22 -05:00
Jeremy Cunningham 6b38133411 Added id specific routh path back for api.delete. 2018-08-08 21:36:24 -05:00
Jeremy Cunningham 39dda80554 Added debug. 2018-08-08 21:02:25 -05:00
Jeremy Cunningham 6cc2bcf2e1 Added debug message. 2018-08-07 13:37:25 -05:00
Jeremy Cunningham dfebdde32e Added missing function argument. 2018-08-07 13:24:39 -05:00
Jeremy Cunningham 167ee5c873 Added genereic delete capability. 2018-08-07 13:09:07 -05:00
Jason Calabrese 8c1548e942 remove DEVICESTATUS_AUTH since it can be handled by default roles, need to update websocket before removing TREATMENTS_AUTH 2016-08-05 00:11:05 -07:00
Ben West 0f735d0af5 implement read-access against token, mod default
Could see an endpoint changing the global server variable, `defaultRoles` as well.
Seems to work well to disable/enable access really quickly.
2016-08-04 15:40:02 -07:00
Jason Calabrese 3d88bd33a6 replace old wares.verifyAuthorization with ctx.authorization.isPermitted; some refactoring 2016-07-31 20:10:10 -07:00
MilosKozak da9cceb548 admin tools initial release 2015-09-24 11:21:08 +02:00
Jason Calabrese fd585720b8 fix lots of little issues reported by codacy 2015-06-30 23:34:59 -07:00
Jason Calabrese 4dfa2c438c ctx everywhere; fixed security.test.js 2015-06-04 23:20:18 -07:00
Jason Calabrese 2dcc8d4d78 removed settings; fixed profiles/profile mixups; fix current/id queries 2015-05-25 23:19:06 -07:00
Ben West 4a0fc8ffef update API to support searching for all types
Should enable searching for all data types.
2015-03-24 18:15:05 -07:00
Jason Calabrese 601662d193 first pass at devicestatus api/storage current only used in the /pebble endpoint 2014-08-31 23:02:09 -07:00