From 9469b7e8ccca8c765036a35c72e424bd1fcf5058 Mon Sep 17 00:00:00 2001 From: Theotime2005 Date: Fri, 10 Jan 2025 11:00:39 +0100 Subject: [PATCH] feat(api): Add a feature toggle --- api/sample.env | 5 +++++ api/src/shared/config.js | 2 ++ .../feature-toggles/feature-toggle-controller_test.js | 1 + 3 files changed, 8 insertions(+) diff --git a/api/sample.env b/api/sample.env index 648bff033cf..53287b38e6a 100644 --- a/api/sample.env +++ b/api/sample.env @@ -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 # ===== diff --git a/api/src/shared/config.js b/api/src/shared/config.js index ed6486c1d09..1818a4202f5 100644 --- a/api/src/shared/config.js +++ b/api/src/shared/config.js @@ -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, @@ -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; diff --git a/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js b/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js index afe7bc7e7d2..d8a062f22b1 100644 --- a/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js +++ b/api/tests/shared/acceptance/application/feature-toggles/feature-toggle-controller_test.js @@ -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,