API 2.1.0 release #30

Merged
inex merged 138 commits from redis/connection-pool into master 2022-12-30 20:25:59 +02:00
  • Added initial support for Redis storage
  • Jobs are now stored in Redis
  • Refactored auth
  • Added redis auth backend, unused yet
  • API is now aware of providers
- Added initial support for Redis storage - Jobs are now stored in Redis - Refactored auth - Added redis auth backend, unused yet - API is now aware of providers
inex added 135 commits 2022-12-30 20:13:02 +02:00
decb98afe2 add providers.py to the list of migrations
Makes providers.py actually run.
f4a7986cfa Remove old cloudflare apiKey field from system test jsons
Strangely, no test were broken. Probably more testing is needed for
token-dependent methods.
5afa2338ca Migrate Jobs to redis
Jobs API shall now use redis to store and retrieve jobs. This will make
it possible to add pubsub for jobs updates. For now it uses blocking api
of redis.
244851c7cc jobs: remove 'jobs' list, and use 'jobs:' prefix
Less complexity, easier to add redis-native TTL
2e9cdf15ab Autostart a redis instance in nix shell.
As a part of test environment, an unprivileged redis server is started on localhost:6379.
Redis connection pool detects when it is run in a development nix shell
and uses this port instead of a production unix socket. This way, redis
tests pass even on computers without redis installed.
144f95fb34 bind nix-shell's redis to localhost
For security, mainly. Also, limit to one process.
A follow up to #22
106a083ca2 jobs: simplify reset
Also ups test coverage
14c4ae26ab explicitly mark helper functions private
I thought about making them private class members, but that would get
unreadable and do more harm than good.
5c86706f4b Jobs: fix value access in is_busy()
Also added a test for is_busy() that highlighted this bug.
063dfafc19 Jobs: fix return value of remove_by_uid
And add a test for said return value.
16e0bd56ce refactor(repository): Tokens repository JSON backend (#18)
Co-authored-by: def <dettlaff@riseup.net>
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-on: #18
Co-authored-by: def <dettlaff@riseup.net>
Co-committed-by: def <dettlaff@riseup.net>
b9c570720b test(tokens-repo): move null recovery token test to json tests
Because the null state seems to be specific to json and not reproducible
in abstract case.
dd525fe723 test(tokens-repo): agnostic use recovery token
converted json-reading asserts to backend-agnostic asserts
73584872f0 test(tokens-repo): agnosticise simple new device key tests
the state of json file is tested separately in test_json_tokens_repository.py
4492bbe995 test(tokens-repo): move null keys and tokens fixtures to json tests
and remove corresponding json files from the folder
ff264ec808 refactor(tokens-repo): simplify getting tokens
get_token_by_token_string and get_token_by_name are no longer tied to
json.
4e60d1d37a refactor(tokens-repo): move token getters to abstract class
Not performance-optimal, but not in critical path either.
100 tokens max irl?
inex added 2 commits 2022-12-30 20:21:52 +02:00
bcfb8e62e9 refactor(repository): Tokens repository JSON backend (#18)
Co-authored-by: def <dettlaff@riseup.net>
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-on: #18
Co-authored-by: def <dettlaff@riseup.net>
Co-committed-by: def <dettlaff@riseup.net>
inex added 1 commit 2022-12-30 20:25:35 +02:00
inex merged commit b5ee542693 into master 2022-12-30 20:25:59 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SelfPrivacy/selfprivacy-rest-api#30
There is no content yet.