Separate jwtproxy signer config from secscan config

This commit is contained in:
Evan Cordell 2016-04-27 08:30:05 -05:00 committed by Jimmy Zelinskie
parent 474884acd7
commit f4d2fae5d8
2 changed files with 5 additions and 3 deletions

View file

@ -288,8 +288,8 @@ class DefaultConfig(object):
'API_VERSION': 'v1',
'API_TIMEOUT_SECONDS': 10,
'API_TIMEOUT_POST_SECONDS': 480,
'PROXY': 'http://localhost:8080',
}
JWTPROXY_SIGNER = 'https://localhost:8080'
# Torrent management flags
FEATURE_BITTORRENT = False

View file

@ -5,7 +5,7 @@ from data.database import CloseForLongOperation
from data import model
from data.model.storage import get_storage_locations
from urlparse import urljoin
from urlparse import urljoin, urlparse
from util.secscan.validator import SecurityConfigValidator
logger = logging.getLogger(__name__)
@ -253,11 +253,13 @@ class SecurityScannerAPI(object):
api_url = urljoin(endpoint, '/' + security_config['API_VERSION']) + '/'
url = urljoin(api_url, relative_url)
signer_proxy_url = self.config.get('JWTPROXY_SIGNER', 'https://localhost:8080')
with CloseForLongOperation(self.config):
logger.debug('%sing security URL %s', method.upper(), url)
return client.request(method, url, json=body, params=params, timeout=timeout,
cert=self._keys, verify='/conf/mitm.cert', headers=headers,
proxies={
self.config.get('PREFERRED_URL_SCHEME', 'http'): security_config.get('PROXY')
urlparse(signer_proxy_url).scheme: signer_proxy_url
})