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",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
"line_number": 120,
"line_number": 118,
"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 &
env:
NOTIFY_ENVIRONMENT: scanning
FEATURE_ABOUT_PAGE_ENABLED: true
- name: Run OWASP Baseline Scan
uses: zaproxy/action-baseline@v0.14.0
with:

View File

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

View File

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