Commit Graph

69 Commits

Author SHA1 Message Date
84db98b6f6
sql_app: Remove hard coded HTTPException codes
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 21:40:01 +03:00
2811b8a5ef
sql_app: update TODO
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 21:29:08 +03:00
b394bd9f2b
hot fix
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 21:14:25 +03:00
4fdd7c231c
sql_app: door: check if valid token on file requests
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 21:09:38 +03:00
b790c6657a
sql_app: door: send actual access_list_counter instead of 0
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 20:15:24 +03:00
0125f3e5fc
sql_app: Add correct door mac
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 20:01:43 +03:00
6f45fc95aa sql_app: remove record_user_connection() due to bug. fix later
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 19:17:32 +03:00
3bcb333df6
sql_app: Added state to Iot Door
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 18:58:23 +03:00
2eed2db77e sql_app: data: collect user connection times
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 16:11:39 +03:00
d9f3a9da4e
sql_app: Introduce force_close flag for Iot Door
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 15:48:28 +03:00
4789b2778c
sql_app: init_db: Added a link (allowance)
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 15:02:33 +03:00
6850823ae8
sql_app: init_db: Add total of 3 users
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 14:54:04 +03:00
e45e335d50 sql_app: added init db
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 14:41:48 +03:00
311058f09b sql_app: init_secrets: add new variable for first user password
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 14:41:06 +03:00
01e6c990f7
sql_app: Reorder
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 12:58:56 +03:00
bf14c97cb6
sql_app: main: User access list now includes room sensor data
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-07 12:56:10 +03:00
317b3825c3
helper scripts
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 20:07:26 +03:00
7c94abebe5
tests: refactor and added user token tests
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 20:03:15 +03:00
1006baa212
sql_app: tests: Add basic unit tests (User Create)
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 19:26:48 +03:00
89f0bc354c sql_app: Added new endpoints to fetch iot dev access list info
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 18:17:03 +03:00
80f6c629d4 sql_app: create user now stores new api token
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 18:16:06 +03:00
2b4d3bf7f5 sql_app: Implemented access list counter:
A counter is associated with every
	Iot Device. The counter is always increment
	when a user is allowed or disallowed to use
	the device, hence, ensuring coherency.
	It is also now exposed in the
	IotDoorPollingRequest schema, enabling the
	Iot Device to fetch the new access list.

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 16:38:35 +03:00
3a6a1ccefd sql_app: db: Changed incorrect variable name
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-06 16:33:02 +03:00
244b7c6b91
sql_app: db: Fixed column copy warning.
A warning was raised whenever the user<->device
	relation was accessed. The assumption is that
	now the queries perform faster, having fixed
	this issue.

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-05 17:10:35 +03:00
232ff82c46 sql_app: save last issued token in user record
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-05 16:25:20 +03:00
59757ae269
sql_app: TODO
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-06-05 14:02:50 +03:00
2c4840b5c3
sql_app: Change defualt page title
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-25 16:36:06 +03:00
f4b0e886cc sql_app: Added function to get room info (temp, people ...)
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 21:04:19 +03:00
36123b1090 sql_app: Access log for user (access history)
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 19:44:04 +03:00
52a7cffce2 sql_app: Added access log request
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 19:02:54 +03:00
575ba9452a users/open: pass in time for door to stay open
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 14:58:30 +03:00
e9925d32b4 clear open_door attr from doors when read.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 14:36:29 +03:00
bae51c3f67 Added data storage tables and types
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-23 13:46:09 +03:00
3bf883b6ac remove check 2022-05-08 22:27:41 +03:00
6e74778241 main: temp spelling
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-08 22:20:39 +03:00
dc4e3ef8d6 main: add iot functions for monitor and door
- Echo back for monitor for now.
   - Needs database tables and linkage

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-05-08 22:09:06 +03:00
3302c4dc39 main, crud: implement disallow user
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-18 02:39:45 +03:00
32c58daf57 main: remove APIKey dependancy for admin paths...
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-18 01:55:06 +03:00
20f4d0202f crud: use indexed primary key search rather than list all
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-18 01:54:33 +03:00
f5d7db5071 crud: fix open door command db commit
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-18 01:48:44 +03:00
34f27c32e8
users: Add open door command from user application
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-18 01:43:12 +03:00
d8bb92a48a main: alias user token gen with '/users/tkn'
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-17 21:35:26 +03:00
48e4f0ab48 crud: get iot by BT
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-17 21:34:50 +03:00
59417427c3 main: Implement generation of IotDev Token
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-17 21:20:45 +03:00
4617e5a7a2
auth_helper: basic method to gen a permenant token
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-17 02:20:14 +03:00
a329ad3b10
TODO list
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-14 15:01:35 +03:00
7d4f49d0e7
init_secrets: script to init .env values
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-14 07:19:53 +03:00
b08a24bedf
admin: All admin path functions require an APIKey
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-14 07:16:28 +03:00
17aa68ba9a
allow user: allow acces to room by name or id
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-14 01:37:30 +03:00
5387610d35
main: remove async. not sure if it is safe to use
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-04-13 23:23:42 +03:00