Commit Graph

16 Commits

Author SHA1 Message Date
Fabio Manganiello ae17a12c12
FIX: `UserManager.get_users`
`UserManager.get_users` should not return a reference to the query
object, since the query object will be invalidated as soon as the
connection is closed.

Instead, it should return directly the list of `User` objects.
2022-11-21 00:57:00 +01:00
Fabio Manganiello 69e097707d
Don't lock read session from the main database 2022-11-12 16:10:57 +01:00
Fabio Manganiello 86edd70d93
Fixed session/concurrency management on the main SQLite db
- The `declarative_base` instance should be shared
- Database `session_locks` should be stored at module, not instance
  level
- Better isolation of scoped sessions
- Enclapsulated `get_session` method in `UserManager`
2022-11-12 15:36:17 +01:00
Fabio Manganiello 6b7933cd33
Using a different SQLite database for entities
This prevents multiprocessing/concurrency issues when modifying the same
database file both from the main process and from the web server process
2022-11-12 02:00:55 +01:00
Fabio Manganiello 3fc94181b7
LINT fixes 2022-11-11 22:02:36 +01:00
Fabio Manganiello 8a70f1d38e
Replaced deprecated sqlalchemy.ext.declarative with sqlalchemy.orm 2022-04-05 22:47:44 +02:00
Fabio Manganiello 4ee7e4db29
Basic support for entities on the local db and implemented support for switch entities on the tplink plugin 2022-04-04 16:50:17 +02:00
Fabio Manganiello 1a314ffd6b Fixed LGTM errors and warnings 2021-09-17 22:21:29 +02:00
Fabio Manganiello 3bfc5b83ef Moved to manifest files for describing plugins and backends and their dependencies 2021-09-16 17:53:40 +02:00
Fabio Manganiello 87b70716c1 Logic for supporting JWT tokens both as bytes and strings [closes #197] 2021-08-24 22:55:42 +02:00
Fabio Manganiello 2a78f81a7b Major LINT fixes 2021-04-05 00:58:44 +02:00
Fabio Manganiello 570f1d0cf6 Passing expire_on_commit=False on sessionmaker() [see #181]
Accessing db objects outside of their session seems to fail on SQLAlchemy >= 1.4
with a `Instance `Instance <x> is not bound to a Session` error.

Setting expire_on_commit=False on the session seems to somehow fix the issue
(see https://stackoverflow.com/questions/3039567/sqlalchemy-detachedinstanceerror-with-regular-attribute-not-a-relation)
2021-03-25 20:30:51 +01:00
Fabio Manganiello 748609c6f4 Migrated settings panel and logout button 2021-02-15 23:09:27 +01:00
Fabio Manganiello b3c28f6773 Added support for JWT token-based authentication 2021-02-12 22:43:34 +01:00
Fabio Manganiello f86e2eb5a7 Implemented settings page and finalized multi-user support 2019-07-19 00:50:52 +02:00
Fabio Manganiello 1c1ecc18df Support for multi-users and authentication for HTTP pages 2019-07-15 14:12:00 +02:00