USACE / USACE/cwms-data-api

Endpoint for Togglz Feature Flags

Open
#1,786 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion-point enhancement priority:low
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

Summary

Add an authenticated CDA endpoint that exposes the Togglz feature flags currently active on the running server.

Suggestions:

  • GET /admin/features
  • GET /features

The endpoint should allow authenticated users, and possibly only admin users, to view which server-side feature flags are set at runtime.

Problem

PR #1785 improves how CDA loads default feature properties from the classpath when no external Togglz properties file is configured.

That helps make the configured defaults work correctly, but it is still difficult to confirm what feature state is actually active on a deployed server. A runtime endpoint would make it easier to verify whether packaged defaults, mounted features.properties, or -Dproperties.file=... overrides are the values CDA is actually using.

This would be especially useful when debugging environment-specific behavior. Currently there's stack-trace inclusion, object-storage blob behavior, and auth compatibility flags.

Proposed Behavior

Add a read-only endpoint that returns the current Togglz feature states known to CDA.

Suggested response fields:

  • feature name
  • enabled/active state
  • label/description, if available from the Togglz annotation

Something like:

{
  "features": [
    {
      "name": "INCLUDE_ERROR_STACK_TRACES",
      "enabled": true,
      "label": "Include stack traces in JSON error responses for authorized debug requests"
    }
  ]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing authenticated CDA endpoint patterns and the Togglz configuration described alongside PR #1785, including packaged defaults, features.properties, and -Dproperties.file overrides. Define the read-only GET /admin/features or /features response around the runtime feature states and available labels, and verify that the endpoint exposes the intended authenticated or admin-only view.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.