Class FeaturesController
- Namespace
- SEBT.Portal.Api.Controllers
- Assembly
- SEBT.Portal.Api.dll
Controller for handling feature flag queries.
[ApiController]
[AllowAnonymous]
[Route("api/features")]
public class FeaturesController : ControllerBase
- Inheritance
-
objectControllerBaseFeaturesController
Constructors
FeaturesController(IFeatureFlagQueryService)
Initializes a new instance of the FeaturesController class.
public FeaturesController(IFeatureFlagQueryService featureFlagQueryService)
Parameters
featureFlagQueryServiceIFeatureFlagQueryServiceThe feature flag query service.
Methods
GetFeatureFlags(CancellationToken)
Gets the current feature flag states. Returns flags from state-specific JSON files (appsettings.{State}.json), AWS AppConfig (if configured), or defaults. Flags are merged in priority order with state-specific JSON having the highest priority. State-specific configuration is loaded from appsettings.{State}.json files based on the STATE environment variable. Unknown flags and internal-only flags (OTP bypass, diagnostic endpoints) are not included in the response.
[HttpGet]
[Produces("application/json", new string[] { })]
[ProducesResponseType(typeof(Dictionary<string, bool>), 200)]
[ProducesResponseType(499)]
[ProducesResponseType(500)]
[Tags(new string[] { "Features" })]
public Task<IActionResult> GetFeatureFlags(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<IActionResult>
An OK result with feature flag states as JSON.