-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add origin trials API key variable to server settings (#3213)
* Add OT API key variable to settings * fix type hint * Update settings.py Co-authored-by: James C Scott III <[email protected]> * fix quotes * Move api key function to secrets file * Add key generation command and doc explanation * remove OT_API_KEY from settings * update global var * Save API key in var to remove need to re-obtain * logging change --------- Co-authored-by: James C Scott III <[email protected]>
- Loading branch information
1 parent
13f0703
commit a8f4155
Showing
7 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,6 @@ tutorial-env | |
|
||
# Testdata for Python tests | ||
testdata | ||
|
||
# API Key for local development | ||
ot_api_key.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ coverage | |
|
||
# venv directory | ||
cs-env | ||
|
||
# API Key for local development | ||
ot_api_key.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import logging | ||
import os | ||
from typing import Any, Optional | ||
|
||
from framework.secrets import get_ot_api_key | ||
|
||
|
||
ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
|
@@ -12,7 +13,7 @@ def get_flask_template_path() -> str: | |
|
||
# By default, send all email to an archive for debugging. | ||
# For the live cr-status server, this setting is None. | ||
SEND_ALL_EMAIL_TO: Optional[str] = ( | ||
SEND_ALL_EMAIL_TO: str|None = ( | ||
'cr-status-staging-emails+%(user)s+%(domain)[email protected]') | ||
|
||
BOUNCE_ESCALATION_ADDR = '[email protected]' | ||
|
@@ -74,6 +75,9 @@ def get_flask_template_path() -> str: | |
# Truncate some log lines to stay under limits of Google Cloud Logging. | ||
MAX_LOG_LINE = 200 * 1000 | ||
|
||
# Origin trials API URL | ||
OT_API_URL = 'https://staging-chromeorigintrials-pa.sandbox.googleapis.com' | ||
OT_API_KEY: str|None = None # Value is set later when request is needed. | ||
|
||
if UNIT_TEST_MODE: | ||
APP_TITLE = 'Local testing' | ||
|
@@ -89,6 +93,7 @@ def get_flask_template_path() -> str: | |
SEND_EMAIL = True | ||
SEND_ALL_EMAIL_TO = None # Deliver it to the intended users | ||
SITE_URL = 'https://chromestatus.com/' | ||
OT_API_URL = 'https://chromeorigintrials-pa.googleapis.com' | ||
GOOGLE_SIGN_IN_CLIENT_ID = ( | ||
'999517574127-7ueh2a17bv1ave9thlgtap19pt5qjp4g.' | ||
'apps.googleusercontent.com') | ||
|