ohcnetwork / docs

https://docs.ohc.network
MIT License
1 stars 13 forks source link

Build a Feature Flipper in CARE #46

Open gigincg opened 2 months ago

gigincg commented 2 months ago

Overview

Implement a feature flipper system in CARE, starting with the requirement to control the availability of the Scribe for specific users or facilities OR Available Instance-wide. This feature flipper should be built as a general-purpose module that can be reused across different parts of CARE. The flipper should have an API(to be used by FE) and authorization blockers.

Requirements

  1. Feature Flipper Implementation:

    • Develop a feature flipper mechanism that can toggle features on or off based on user or facility-specific configurations.
    • Management of the Feature Flipper can be done in the Django Admin Panel

      Implementation Approach: Evaluate the feasibility of using an existing package for the feature flipper or consider creating a custom implementation if a suitable package is not available or does not meet the requirements.

  2. API Integration:

    • Create an API endpoint to check if a specific feature (starting with Scribe) is enabled or not for a user or facility.
    • This API should be able to:
      • Accept current_user or facility request_param.
      • Return the status of the feature (enabled/disabled).
  3. Authorization Blockers:

    • Implement authorization logic that prevents unauthorized access to the Scribe feature if it is disabled for a user or facility.
    • Ensure that any attempt to access the Scribe feature via API will be blocked and return an appropriate error message if the feature is not enabled.
  4. Care Scribe Add-On Integration:

    • Update the Care Scribe add-on to utilize the new feature flipper API.
    • Modify the add-on to check the feature status before allowing access to its functionalities.
  5. Documentation:

    • Document the feature flipper's implementation details, including:
      • API endpoints and their usage.
      • How to add new features to the flipper system.
      • How to configure the feature flipper for specific users or facilities.
  6. Deployment:

    • Ensure the feature flipper is deployed in a manner that does not disrupt existing functionality.
    • Perform testing to verify that the feature flipper works as expected and that unauthorized access to disabled features is properly blocked.

Additional Considerations

Checklist