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

Initial Service Implementation #1

Merged
merged 46 commits into from
Dec 20, 2024
Merged

Conversation

NeonDaniel
Copy link
Member

@NeonDaniel NeonDaniel commented Oct 25, 2024

Description

Defines configuration structure as Pydantic objects
Defines an abstract Database class with an SQLite implementation
Includes packaging, unit tests, and automation

Issues

NeonGeckoCom/neon-hana#5
NeonGeckoCom/neon-hana#7
NeonGeckoCom/neon-hana#10
NeonGeckoCom/neon-hana#29

Rebase on NeonGeckoCom/neon-data-models#1
First application NeonGeckoCom/neon-hana#33

Other Notes

Module outlined in this gist

The service methods wrap underlying database CRUD with some added logic to perform input validation and to prevent accidental access to sensitive configuration and accidental deletion.

NeonDaniel and others added 30 commits October 25, 2024 08:38
Define `AccessRoles` enum
Define exceptions for user existence errors
Define database ABC with documented methods
Add models module test coverage
Remove invalid Docker test automation
Fix typo in unit test package installation
Fix check for existing username/user_id
Move user conflict check to internal method in base class
Implement minimal `service.py` with default configuration and ovos-config configuration handling
Document configuration structure
…ation

Add `create_user` method with added check for input passwords being hashed with unit tests
Implement `authenticate_user` method with unit test coverage and an AuthenticationError
Add separate method for reading user entries without authentication data
Add helpers for update/delete operations that perform some degree of input validation
Add unit test coverage for changes
Update exception in `delete_user` to be more specific
Update `TokenConfig` to match/extend existing config used in neon-hana
Update MQ error handling to return HTTP codes for HANA integration
Accept `access_token` in `MQRequest` model as an alternate auth method
Implement unit test automation with config from GHA secrets
Remove created test collections after unit test run
Update Dockerfile to include MongoDB dependency
@NeonDaniel
Copy link
Member Author

TODO

@NeonDaniel NeonDaniel requested a review from mikejgray November 6, 2024 22:50
Prevent update requests from modifying users without validating a token or password
Prevent update requests from allowing an escalation of privileges
Refactor MQ handling to parse specific request models for UserDB CRUD
Copy link
Collaborator

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's still WIP, but I had a look anyway to get acquainted with what's going on. Good stuff so far!

neon_users_service/databases/sqlite.py Show resolved Hide resolved
@NeonDaniel NeonDaniel requested a review from mikejgray December 18, 2024 17:40
@NeonDaniel
Copy link
Member Author

This is ready for review; the only remaining task is to define a license, but otherwise this is complete

Copy link
Collaborator

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NeonDaniel NeonDaniel marked this pull request as ready for review December 20, 2024 01:00
@NeonDaniel NeonDaniel merged commit aff3114 into dev Dec 20, 2024
8 checks passed
@NeonDaniel NeonDaniel deleted the FEAT_InitialImplementation branch December 20, 2024 01:09
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.

2 participants