Skip to content

Commit

Permalink
feat(api): Add a feature toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
theotime2005 committed Jan 10, 2025
1 parent b4b995f commit 9469b7e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,11 @@ TEST_REDIS_URL=redis://localhost:6379
# default: false
# FT_NEW_LEGAL_DOCUMENTS_VERSIONING=false

# Enable user token aud confinement
# type: boolean
# default: false
# FT_USER_TOKEN_AUD_CONFINEMENT_ENABLED=false

# =====
# CPF
# =====
Expand Down
2 changes: 2 additions & 0 deletions api/src/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const configuration = (function () {
isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED),
isSelfAccountDeletionEnabled: toBoolean(process.env.FT_SELF_ACCOUNT_DELETION),
isQuestEnabled: toBoolean(process.env.FT_ENABLE_QUESTS),
isUserTokenAudConfinementEnabled: toBoolean(process.env.FT_USER_TOKEN_AUD_CONFINEMENT_ENABLED),
isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON),
isLegalDocumentsVersioningEnabled: toBoolean(process.env.FT_NEW_LEGAL_DOCUMENTS_VERSIONING),
setupEcosystemBeforeStart: toBoolean(process.env.FT_SETUP_ECOSYSTEM_BEFORE_START) || false,
Expand Down Expand Up @@ -496,6 +497,7 @@ const configuration = (function () {
config.featureToggles.isSelfAccountDeletionEnabled = false;
config.featureToggles.isQuestEnabled = false;
config.featureToggles.isAsyncQuestRewardingCalculationEnabled = false;
config.featureToggles.isUserTokenAudConfinementEnabled = false;
config.featureToggles.isTextToSpeechButtonEnabled = false;
config.featureToggles.isLegalDocumentsVersioningEnabled = false;
config.featureToggles.showNewResultPage = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Acceptance | Shared | Application | Controller | feature-toggle', func
'is-pix1d-enabled': true,
'is-pix-companion-enabled': false,
'is-quest-enabled': false,
'is-user-token-aud-confinement-enabled': false,
'is-self-account-deletion-enabled': false,
'is-text-to-speech-button-enabled': false,
'is-legal-documents-versioning-enabled': false,
Expand Down

0 comments on commit 9469b7e

Please sign in to comment.