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

refactor authentication and user modules to typescript #237

Draft
wants to merge 183 commits into
base: develop
Choose a base branch
from

Conversation

restjohn
Copy link
Member

@restjohn restjohn commented Dec 1, 2024

This PR is a work in progress for refactoring all modules and code related to authentication and user management to strongly-typed TypeScript modules adhering to clean architecture patterns using dependency injection. There are many comments in code tagged with TODO: users-next: ... with notes on changes yet to be made.

A large portion of this PR centers around refactoring Mage's authentication mechanisms for clarity and eliminating redundancy of enrollment logic between different authentication protocols. All authentication-related modules now reside in the service/src/ingress directory.

This branch does not yet build. Once all necessary changes are complete, tests will need corresponding updates. Developers should implement integration tests with dependency injection mocks to exercise the full authentication path.

Once refactoring and testing are complete, implement a plugin that creates a large user set on the order of 100,000 users for scalability testing. The plugin should accept core user services available through dependency injection in order to enroll users for testing.

The merge for this branch should be relatively easy, despite many renamed modules and changes. This work has been isolated to authentication and user management operations which are secondary use cases relative to core business logic goals of Mage and should not have much, if any, conflict with any other recent development work. Nevertheless, this effort represents a large and necessary resolution of technical debt contributing to stability, testability, and developer experience.

restjohn added 30 commits July 8, 2024 15:03
…ated api routes, which does not seem to be used by any client or anywhere else in the service
…pository and use the mongoose doctype parameter as intended to represent raw db documents instead of a hydrated mongoose document-model instance
… internal services to allow dependency injection and reuse
…entity mapping and some interface methods; remove authentication id foreign key and unused icon type property from schema
…dleware; mage does not require a session cookie
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.

1 participant