GET /api/settings/feature-flag/{key}
Get feature flag status
GET
Authentication
Not Required:[AllowAnonymous] (Line 31)
Feature flags are public
Path Parameters
Feature flag keyValidation (Lines 36-44):Known Keys:
public_sharing: Enables public/unlisted thread access
Response
Echo of requested feature flag key (Line 50)
Feature flag status (Line 51)Values:
true: Feature enabledfalse: Feature disabled or doesn’t exist
Side Effects
Database Reads (Line 46):system_settingstable
Authorization
Public Access: No authentication required Security: Feature flag keys/values visible to anyonePermissions
Who Can Read: Anyone (unauthenticated access allowed)Edge Cases
- Empty key: 400 error (Lines 36-44)
- Whitespace-only key: 400 error (Lines 36-44)
- Unknown key: Returns
false(service-level default, not enforced by server contract) - Null key: 400 error
- Case sensitivity: Not enforced by server contract (service-dependent)
Error Conditions
| Code | HTTP | Cause | Controller Line |
|---|---|---|---|
INVALID_REQUEST | 400 | Key null/empty/whitespace | 36-44 |
SETTINGS_ERROR | 500 | Service exception | 54-62 |
Behavioral Guarantees
Default Value:false for unknown keys (service-level, not enforced by server contract)
Idempotency: YES (same key always returns same value until changed)
Cache-Safe: Can be cached (feature flags change infrequently)
Known Feature Flags
public_sharing:- Controls thread visibility for public/unlisted threads
- Used by ThreadsController (Lines 134, 216)
- When
false: All threads owner-only - When
true: Public/unlisted threads accessible anonymously
Use Cases
Frontend Configuration:- Check if features should be shown/hidden
- Enable/disable UI components based on flags
- ThreadsController checks
public_sharingfor access control
Performance
Query Complexity: Single SELECT by primary key Index:system_settings.key should be indexed
Response Time: Sub-10ms (simple key-value lookup)
Caching: Not documented in controller (service may cache)
Security Implications
Public Visibility: Feature flag names and values exposed- No sensitive data should be in feature flags
- Use for boolean toggles only