feat(devops): Add ability for user to turn off feature flagging check-in
ref: #679 #496
This commit is contained in:
@ -68,6 +68,7 @@ CELERY_WORKER_MAX_TASKS_PER_CHILD = 1 # worker_max_tasks_per_child
|
|||||||
CELERY_TASK_SEND_SENT_EVENT = True
|
CELERY_TASK_SEND_SENT_EVENT = True
|
||||||
CELERY_WORKER_SEND_TASK_EVENTS = True # worker_send_task_events
|
CELERY_WORKER_SEND_TASK_EVENTS = True # worker_send_task_events
|
||||||
|
|
||||||
|
FEATURE_FLAGGING_ENABLED = True # Turn Feature Flagging on/off
|
||||||
|
|
||||||
# PROMETHEUS_METRICS_EXPORT_PORT_RANGE = range(8010, 8010)
|
# PROMETHEUS_METRICS_EXPORT_PORT_RANGE = range(8010, 8010)
|
||||||
# PROMETHEUS_METRICS_EXPORT_PORT = 8010
|
# PROMETHEUS_METRICS_EXPORT_PORT = 8010
|
||||||
@ -472,3 +473,20 @@ is yours. If you do change the value ensure that it's still hashed as a sha256 h
|
|||||||
"""
|
"""
|
||||||
unique_id = str(f'{CELERY_BROKER_URL}{DOCS_ROOT}{SITE_URL}{SECRET_KEY}{feature_flag_version}')
|
unique_id = str(f'{CELERY_BROKER_URL}{DOCS_ROOT}{SITE_URL}{SECRET_KEY}{feature_flag_version}')
|
||||||
unique_id = hashlib.sha256(unique_id.encode()).hexdigest()
|
unique_id = hashlib.sha256(unique_id.encode()).hexdigest()
|
||||||
|
|
||||||
|
if FEATURE_FLAGGING_ENABLED:
|
||||||
|
|
||||||
|
FEATURE_FLAGGING_URL = 'https://alfred.nofusscomputing.com/api/v2/public/4/flags/1'
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
|
||||||
|
FEATURE_FLAGGING_URL = 'http://127.0.0.1:8002/api/v2/public/1/flags/2844'
|
||||||
|
|
||||||
|
feature_flag = {
|
||||||
|
'url': str(FEATURE_FLAGGING_URL),
|
||||||
|
'user_agent': 'Centurion ERP',
|
||||||
|
'cache_dir': str(BASE_DIR) + '/',
|
||||||
|
'disable_downloading': False,
|
||||||
|
'unique_id': unique_id,
|
||||||
|
'version': feature_flag_version
|
||||||
|
}
|
||||||
|
@ -22,3 +22,12 @@ It's completely your choice how you expose this endpoint although with the cavea
|
|||||||
- `HTTP/200 - Success`
|
- `HTTP/200 - Success`
|
||||||
|
|
||||||
When the client checks-in and the feature flags have been supplied. If the user does not specify request header `If-Modified-Since:`, the feature flags will always be returned.
|
When the client checks-in and the feature flags have been supplied. If the user does not specify request header `If-Modified-Since:`, the feature flags will always be returned.
|
||||||
|
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
|
||||||
|
Within your settings file the following settings are available
|
||||||
|
|
||||||
|
| Attribute | Type | Default | Description |
|
||||||
|
|:---|:---:|:---:|:---|
|
||||||
|
| FEATURE_FLAGGING_ENABLED | `Bolean` | `True `| Turn feature flagging on/off |
|
||||||
|
@ -29,8 +29,10 @@ DATABASES = {
|
|||||||
#
|
#
|
||||||
# CELERY_BROKER_URL = 'amqp://<username>:<password>@<host>:<port>/[<message host>]' # 'amqp://' is the connection protocol
|
# CELERY_BROKER_URL = 'amqp://<username>:<password>@<host>:<port>/[<message host>]' # 'amqp://' is the connection protocol
|
||||||
|
|
||||||
|
FEATURE_FLAGGING_ENABLED = True # Turn Feature Flagging on/off
|
||||||
|
|
||||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||||
|
|
||||||
SECURE_SSL_REDIRECT = True
|
SECURE_SSL_REDIRECT = True
|
||||||
|
|
||||||
USE_X_FORWARDED_HOST = True
|
USE_X_FORWARDED_HOST = True
|
||||||
|
Reference in New Issue
Block a user