mirror of
https://github.com/fleetdm/fleet
synced 2026-05-17 05:58:40 +00:00
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #36670 Refactoring `middleware/endpoint_utils` package to remove direct dependencies on: - fleet.Service - android.Service Specific changes are: - replace AuthFunc+FleetService with AuthMiddleware - Move the definition of handler functions to the respective services and use a generic `CommonEndpointer[H any] struct` Although this was discovered as part of Activity bounded context research, this change is not directly related to bounded contexts. In retrospect, this decoupling should have been done when creating the Android service for ADR-0001. ## Testing - [x] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Internal restructuring of endpoint handling and authentication middleware composition to improve code maintainability and type safety. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|---|---|---|
| .. | ||
| mock | ||
| service | ||
| tests | ||
| android.go | ||
| arch_test.go | ||
| datastore.go | ||
| errors.go | ||
| pubsub.go | ||
| README.md | ||
| service.go | ||
The MDM Android package attempts to decouple Android-specific service and datastore implementations from the core Fleet server code.
Any tightly coupled code that needs both the core Fleet server and the Android-specific features must live in the main server/fleet, server/service, and server/datastore packages. Typical example are MySQL queries. Any code that implements Android-specific functionality should live in the server/mdm/android package. For example, the common code from server/datastore package can call the android datastore methods as needed.
This decoupled approach attempts to achieve the following goals:
- Easier to understand and find Android-specific code.
- Easier to fix Android-specific bugs and add new features.
- Easier to maintain Android-specific feature branches.
- Faster Android-specific tests, including ability to run all tests in parallel.