This commit is contained in:
Frank Bertsch 2018-11-07 15:38:26 -06:00
Родитель e3c9913b89
Коммит 36cc3f5e3e
3 изменённых файлов: 1 добавлений и 10 удалений

Просмотреть файл

@ -78,15 +78,13 @@ AUTH0_DOMAIN = "auth.mozilla.auth0.com"
AUTH0_API_AUDIENCE = "https://aggregates.telemetry.mozilla.org/"
AUTH0_ALGORITHMS = ["RS256"]
AUTH0_REQUIRED_SCOPE = "read:aggregates"
auth0_cache = ExpiringDict(max_len=1000, max_age_seconds=15*60)
auth0_cache = ExpiringDict(max_len=1000, max_age_seconds=15 * 60)
# CSP Headers
DEFAULT_CSP_POLICY = "frame-ancestors 'none'; default-src 'self'"
DEFAULT_X_FRAME_POLICY = "DENY"
# Error handler
class AuthError(Exception):
def __init__(self, error, status_code):
@ -199,7 +197,6 @@ def check_auth():
raise AuthError({"code": "access_denied",
"description": "Access not allowed"}, 403)
def is_authed():
try:
@ -485,7 +482,6 @@ def get_dates_metrics(prefix, channel):
mapping = {"true": True, "false": False}
dimensions = {k: mapping.get(v, v) for k, v in request.args.iteritems()}
extra_dimensions = dimensions.viewkeys() - ALLOWED_DIMENSIONS
if extra_dimensions:
# We received an unsupported query string to filter by, return 405.

Просмотреть файл

@ -169,7 +169,6 @@ private_keyed_scalars_template = {
"telemetry.dynamic_event_counts": {
"some#dynamic#event": SCALAR_VALUE
}
}

Просмотреть файл

@ -150,7 +150,6 @@ class ServiceTestCase(unittest.TestCase):
set(qs.keys())
)
# Test response content.
def test_cached_auth(self):
token = "cached-token"
@ -191,7 +190,6 @@ class ServiceTestCase(unittest.TestCase):
assert cache.get((url, False)).data != cache.get((url, True)).data
def test_response_cache_auth_first(self):
token = 'cached-token'
route = '/aggregates_by/build_id/channels/'
@ -222,7 +220,6 @@ class ServiceTestCase(unittest.TestCase):
assert cache.get((url, False)).data != cache.get((url, True)).data
def test_clear_cache(self):
route = '/aggregates_by/build_id/channels/'
url = 'http://localhost' + route
@ -238,7 +235,6 @@ class ServiceTestCase(unittest.TestCase):
assert cache.get((url, False)) is None
def test_auth_header(self):
for metric in histograms_template.keys():
resp = self.app.get(