mage-server icon indicating copy to clipboard operation
mage-server copied to clipboard

refactor authentication and user modules to typescript

Open restjohn opened this issue 1 year ago • 0 comments

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 avatar Dec 01 '24 06:12 restjohn