Merge pull request #1122 from dod-ccpo/set-server-name-2
Specify Flask SERVER_NAME value for Celery worker.
This commit is contained in:
commit
15f9fb8353
@ -193,7 +193,7 @@ def make_config(direct_config=None):
|
|||||||
)
|
)
|
||||||
OVERRIDE_CONFIG_FILENAME = os.getenv("OVERRIDE_CONFIG_FULLPATH")
|
OVERRIDE_CONFIG_FILENAME = os.getenv("OVERRIDE_CONFIG_FULLPATH")
|
||||||
|
|
||||||
config = ConfigParser()
|
config = ConfigParser(allow_no_value=True)
|
||||||
config.optionxform = str
|
config.optionxform = str
|
||||||
|
|
||||||
config_files = [BASE_CONFIG_FILENAME, ENV_CONFIG_FILENAME]
|
config_files = [BASE_CONFIG_FILENAME, ENV_CONFIG_FILENAME]
|
||||||
|
@ -25,6 +25,7 @@ REDIS_URI = redis://localhost:6379
|
|||||||
RQ_QUEUES = atat_%(ENVIRONMENT)s
|
RQ_QUEUES = atat_%(ENVIRONMENT)s
|
||||||
SECRET = change_me_into_something_secret
|
SECRET = change_me_into_something_secret
|
||||||
SECRET_KEY = change_me_into_something_secret
|
SECRET_KEY = change_me_into_something_secret
|
||||||
|
SERVER_NAME
|
||||||
SESSION_COOKIE_NAME=atat
|
SESSION_COOKIE_NAME=atat
|
||||||
SESSION_TYPE = redis
|
SESSION_TYPE = redis
|
||||||
SESSION_USE_SIGNER = True
|
SESSION_USE_SIGNER = True
|
||||||
|
@ -7,4 +7,4 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
TZ: UTC
|
TZ: UTC
|
||||||
DISABLE_CRL_CHECK: "True"
|
DISABLE_CRL_CHECK: "True"
|
||||||
CRL_STORAGE_PROVIDER: CLOUDFILES
|
SERVER_NAME: aws.atat.code.mil
|
||||||
|
@ -7,4 +7,4 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
TZ: UTC
|
TZ: UTC
|
||||||
DISABLE_CRL_CHECK: "True"
|
DISABLE_CRL_CHECK: "True"
|
||||||
CRL_STORAGE_PROVIDER: CLOUDFILES
|
SERVER_NAME: azure.atat.code.mil
|
||||||
|
@ -89,16 +89,17 @@ def protected_routes(app):
|
|||||||
|
|
||||||
|
|
||||||
def test_protected_routes_redirect_to_login(client, app):
|
def test_protected_routes_redirect_to_login(client, app):
|
||||||
|
server_name = app.config.get("SERVER_NAME") or "localhost"
|
||||||
for rule, protected_route in protected_routes(app):
|
for rule, protected_route in protected_routes(app):
|
||||||
if "GET" in rule.methods:
|
if "GET" in rule.methods:
|
||||||
resp = client.get(protected_route)
|
resp = client.get(protected_route)
|
||||||
assert resp.status_code == 302
|
assert resp.status_code == 302
|
||||||
assert "http://localhost/" in resp.headers["Location"]
|
assert server_name in resp.headers["Location"]
|
||||||
|
|
||||||
if "POST" in rule.methods:
|
if "POST" in rule.methods:
|
||||||
resp = client.post(protected_route)
|
resp = client.post(protected_route)
|
||||||
assert resp.status_code == 302
|
assert resp.status_code == 302
|
||||||
assert "http://localhost/" in resp.headers["Location"]
|
assert server_name in resp.headers["Location"]
|
||||||
|
|
||||||
|
|
||||||
def test_get_protected_route_encodes_redirect(client):
|
def test_get_protected_route_encodes_redirect(client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user