Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redis db support #18

Merged
merged 9 commits into from
Sep 6, 2024
Merged

Add Redis db support #18

merged 9 commits into from
Sep 6, 2024

Conversation

ncvescera
Copy link
Member

@ncvescera ncvescera commented Aug 28, 2024

No description provided.

Fixed a 'c.execute()' invoked with no query.
@ncvescera ncvescera linked an issue Aug 28, 2024 that may be closed by this pull request
3 tasks
Added redis db support and rewrited all 'db.py' fuctions:

1. `__init__`: Initializes an instance of RedisRequestManager with a given Redis connection and index.
2. `add_request`: Adds a new request for a user, checks for duplicates, and sets the initial keys in Redis.
3. `delete_request`: Deletes all keys related to a specific user's request.
4. `update_request_status`: Updates the status of a request based on its current status.
5. `get_request_data`: Retrieves the data associated with a specific user's request, including start date, end date, and status.
6. `get_all_request_data`: Retrieves all request data for all users in Redis.
Added Redis ip and password to the configuration files for
proper setup and usage of Redis in the application.
Added 'tests.py' file for testing Redis database functionality.
Now DBManager is created after loading configs from file because it
needs the REDIS user and password.
Fixed wrong return type when no request found: now returns a '{}' (empty
dict).
Fixed a problem with updating request status: 'enddate' now is unset
when status is changed from 'approved' to 'pending' (revoke request).
Adapted routes data (dict keys) with new redis db.
@ncvescera ncvescera linked an issue Sep 3, 2024 that may be closed by this pull request
@ncvescera ncvescera merged commit bb40acd into main Sep 6, 2024
1 of 2 checks passed
@ncvescera ncvescera deleted the redis branch September 6, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LDAP Users fields Redis
1 participant