Skip to content

[Feature] Configurable API Endpoints (Only info mandatory) #49

@mdwRepository

Description

@mdwRepository

Is your feature request related to a problem? Please describe.

Not every installation of the RIS Synergy API requires all available endpoints. For example, some installations may only need the info endpoint, while others might require endpoints for orgunit, project, or funding. However, currently, all endpoints are enabled by default, which could increase overhead or expose unnecessary interfaces.

Describe the solution you'd like

Add a configuration option to the .env file (based on the env.template) to enable or disable specific API endpoints.

  • Mandatory: The info endpoint must always remain enabled.
  • Optional: Other endpoints (orgunit, project, funding, etc.) can be listed in a comma-separated format.
# Specify enabled endpoints as a comma-separated list
# Info is always enabled by default
ENABLED_ENDPOINTS=orgunit,project,funding

Proposed Behavior

  • The application reads the ENABLED_ENDPOINTS variable at startup.
  • Endpoints listed in the variable are registered dynamically in Flask.
  • Requests to endpoints not enabled will return a 404 Not Found.

Additional Context

  • This feature enhances flexibility for installations with minimal requirements.
  • It improves security by limiting exposure to unused endpoints.
  • This aligns the API with the principle of minimal resource exposure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions