Merge pull request #1761 from coreos-inc/nginx-direct-download
Add feature flag to force all direct download URLs to be proxied
This commit is contained in:
commit
684ace3b5a
13 changed files with 353 additions and 35 deletions
|
@ -41,7 +41,7 @@ from endpoints.verbs import verbs
|
|||
from image.docker.schema1 import DockerSchema1ManifestBuilder
|
||||
from initdb import wipe_database, initialize_database, populate_database
|
||||
from jsonschema import validate as validate_schema
|
||||
from util.security.registry_jwt import decode_bearer_token
|
||||
from util.security.registry_jwt import decode_bearer_header
|
||||
|
||||
|
||||
try:
|
||||
|
@ -1542,7 +1542,7 @@ class TorrentTestMixin(V2RegistryPullMixin):
|
|||
contents = bencode.bdecode(torrent)
|
||||
|
||||
# Ensure that there is a webseed.
|
||||
self.assertEquals(contents['url-list'], 'http://somefakeurl')
|
||||
self.assertEquals(contents['url-list'], 'http://somefakeurl?goes=here')
|
||||
|
||||
# Ensure there is an announce and some pieces.
|
||||
self.assertIsNotNone(contents.get('info', {}).get('pieces'))
|
||||
|
@ -1886,7 +1886,7 @@ class SquashingTests(RegistryTestCaseMixin, V1RegistryPushMixin, LiveServerTestC
|
|||
contents = bencode.bdecode(response.content)
|
||||
|
||||
# Ensure that there is a webseed.
|
||||
self.assertEquals(contents['url-list'], 'http://somefakeurl')
|
||||
self.assertEquals(contents['url-list'], 'http://somefakeurl?goes=here')
|
||||
|
||||
# Ensure there is an announce and some pieces.
|
||||
self.assertIsNotNone(contents.get('info', {}).get('pieces'))
|
||||
|
@ -1955,9 +1955,9 @@ class V2LoginTests(V2RegistryLoginMixin, LoginTests, RegistryTestCaseMixin, Base
|
|||
|
||||
# Validate the returned token.
|
||||
encoded = response.json()['token']
|
||||
token = 'Bearer ' + encoded
|
||||
header = 'Bearer ' + encoded
|
||||
|
||||
payload = decode_bearer_token(token, instance_keys)
|
||||
payload = decode_bearer_header(header, instance_keys, app.config)
|
||||
self.assertIsNotNone(payload)
|
||||
|
||||
if scope is None:
|
||||
|
|
Reference in a new issue