Merge pull request #2428 from GSA/remove-about-feature-flag

This commit is contained in:
Beverly Nguyen
2025-03-20 16:14:16 -07:00
committed by GitHub
5 changed files with 16 additions and 17 deletions

View File

@@ -151,7 +151,7 @@
"filename": "app/config.py", "filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc", "hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false, "is_verified": false,
"line_number": 120, "line_number": 118,
"is_secret": false "is_secret": false
} }
], ],
@@ -674,5 +674,5 @@
} }
] ]
}, },
"generated_at": "2025-03-17T23:26:44Z" "generated_at": "2025-03-20T18:22:36Z"
} }

View File

@@ -167,7 +167,6 @@ jobs:
run: make run-flask & run: make run-flask &
env: env:
NOTIFY_ENVIRONMENT: scanning NOTIFY_ENVIRONMENT: scanning
FEATURE_ABOUT_PAGE_ENABLED: true
- name: Run OWASP Baseline Scan - name: Run OWASP Baseline Scan
uses: zaproxy/action-baseline@v0.14.0 uses: zaproxy/action-baseline@v0.14.0
with: with:

View File

@@ -169,14 +169,15 @@ def _csp(config):
def create_app(application): def create_app(application):
@application.context_processor # @application.context_processor
def inject_feature_flags(): # def inject_feature_flags():
feature_about_page_enabled = application.config.get( # this is where feature flags can be easily added as a dictionary within context
"FEATURE_ABOUT_PAGE_ENABLED", False # feature_about_page_enabled = application.config.get(
) # "FEATURE_ABOUT_PAGE_ENABLED", False
return dict( # )
FEATURE_ABOUT_PAGE_ENABLED=feature_about_page_enabled, # return dict(
) # FEATURE_ABOUT_PAGE_ENABLED=feature_about_page_enabled,
# )
@application.context_processor @application.context_processor
def inject_initial_signin_url(): def inject_initial_signin_url():

View File

@@ -88,8 +88,6 @@ class Config(object):
], ],
} }
FEATURE_ABOUT_PAGE_ENABLED = getenv("FEATURE_ABOUT_PAGE_ENABLED", "false") == "true"
def _s3_credentials_from_env(bucket_prefix): def _s3_credentials_from_env(bucket_prefix):
return { return {

View File

@@ -23,10 +23,11 @@ from app.utils.user import user_is_logged_in
# Hook to check for feature flags # Hook to check for feature flags
@main.before_request @main.before_request
def check_feature_flags(): def check_feature_flags():
if request.path.startswith("/about") and not current_app.config.get( # Placeholder for future feature flag checks
"FEATURE_ABOUT_PAGE_ENABLED", False # Example:
): # if request.path.startswith("/some-feature") and not current_app.config.get("FEATURE_SOME_FEATURE_ENABLED", False):
abort(404) # abort(404)
pass
@main.route("/test/feature-flags") @main.route("/test/feature-flags")