Commit Graph
28 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 1059232f16 * Add cache update events to websocket API
* Remove the validation for created_at in REST API ;(
2020-09-21 20:46:53 +03: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 b04476e1f9 Normalize Treatment, Entry and Device Status object dates to be all in UTC Strings (#4658)
* Normalize Treatment object dates to be all in UTC Strings, as expected by the codebase

* Also normalize the device status data

* Sort the results so results with mixed dates are returned in correct order

* Use MomentJS to correctly parse the offsets & output the offset to objects at all times

* Removing a debug console log message causing excessive logging

* Use UTC date values for queries even if client asks for zoned dates

* Remove extra sorting based on date. Code clarifications

* * Add missing parseZone() call to treatments
* Check isValid() date on entries

* Use isValid() to check date validity for device status data
2019-07-17 09:03:39 +03:00
Jeremy Cunningham 19e7bc3673 Add insert, query, delete test for treatments api 2018-12-15 16:02:51 -06:00
Sulka Haro 9007db0f63 Fix tests 2017-12-28 19:15:52 +02:00
Jason Calabrese e391baadfe add some debugging to see why count sometimes doesn't match 2017-03-15 00:19:29 -07:00
Jason Calabrese b8880500cb instead of using the data-loaded event, just go back to db directly 2017-03-14 23:57:41 -07:00
Jason Calabrese 3800212f9d bump timeouts more to prevent intermitent failures with benv tests 2016-10-28 17:52:11 -07:00
Jason Calabrese d8b46eecdd refactor init so plugins can be localized 2016-10-15 10:54:20 -07:00
Ben West 9ab886179c teach tests about readable default role
Allows tests to pass naively.  In future this can be augmented
to more thoroughly test security.
2016-08-04 18:02:17 -07:00
Jason Calabrese dad0e83c6e try an new ddata to prevent tests from stepping on each other 2016-06-08 07:44:20 -07:00
Jason Calabrese e3d1b58fdc fix more tests 2016-06-07 23:14:44 -07:00
Jason Calabrese d6dfbed0ea remove debug logging 2016-05-22 10:50:05 -07:00
Jason Calabrese 3d7b813c03 fix/cleanup test 2016-05-21 20:50:14 -07:00
Jason Calabrese 01191c41e5 hack: make the order match 2016-01-06 01:23:23 -08:00
Jason Calabrese 71f7854638 use same doneCalled trick for the other treatment api tests and a ; 2016-01-06 01:17:49 -08:00
Jason Calabrese e22c9bf77c cleanup and maybe fix fragile tests 2016-01-06 01:10:45 -08:00
Jason Calabrese a695a1dd58 upsert treatments based on created_at and eventType
also dedupe and process data within a posted array
more treatment api tests
2016-01-06 00:48:27 -08:00
Jason Calabrese 160bb8bac4 refactor server side data code 2015-12-25 01:31:55 -08:00
Jason Calabrese 4bff4ecf9f 1 more codacy fix 2015-12-06 18:42:38 -08:00
Jason Calabrese e6e833c30e try fixing intermittent test failures 2015-12-06 18:08:04 -08:00
Jason Calabrese 1779e619c1 support for disabling default features
use decodeURIComponent to support environments where spaces in env vars are a problem
converted enable and alarmTypes to arrays
2015-08-23 01:59:24 -07:00
Jason Calabrese c7b3d8e7af careportal fixes; convert values to Number on the server 2015-08-05 21:29:59 -07:00
Jason Calabrese 31ce8cbb92 lot of refactoring to have common settings for client and server 2015-07-30 13:46:13 -07:00
Jason Calabrese d3932cabd1 clean up treatments.create, extend tests to verify it's working 2015-07-26 16:33:05 -07:00
Jason Calabrese f37da2ca3e removed unused _ 2015-07-18 19:45:21 -07:00
Jason Calabrese c96035b57e added some basic tests for the treatment api and loading 2015-07-18 19:31:06 -07:00