fence
fence copied to clipboard
refactor/db-calls: reduce DB usage
Resolves #66.
Notable changes:
- Removes the original
get_current_user()
usage; instead, usescurrent_user
proxy which will do at most 1 lookup for user per request and store the user info from the database as a dictionary - Changes endpoints to use
require_auth
(instead oflogin_required
) and use thecurrent_token
proxy where possible to get necessary information from the token instead of database - Changes
MOCK_AUTH
to be an entire fake token instead of a boolean, to support "stateless" mocked auth
Changes left:
- Change storage manager setup to use token (place that only needs username)
- Appease codacy