Remove jwt validation for jschorr to fix later
Refactor oauth validate method to take config over entire appconfig
This commit is contained in:
parent
7df8ed4a60
commit
301cc6992a
27 changed files with 136 additions and 76 deletions
|
@ -1,14 +1,8 @@
|
|||
from flask import url_for
|
||||
from urlparse import urljoin
|
||||
|
||||
def get_app_url(config):
|
||||
""" Returns the application's URL, based on the given config. """
|
||||
return '%s://%s' % (config['PREFERRED_URL_SCHEME'], config['SERVER_HOSTNAME'])
|
||||
|
||||
def get_app_url_from_scheme_hostname(url_scheme_and_hostname):
|
||||
""" Returns the application's URL, based on the given url scheme and hostname. """
|
||||
return '%s://%s' % (url_scheme_and_hostname.url_scheme, url_scheme_and_hostname.hostname)
|
||||
|
||||
def slash_join(*args):
|
||||
"""
|
||||
Joins together strings and guarantees there is only one '/' in between the
|
||||
|
@ -23,12 +17,3 @@ def slash_join(*args):
|
|||
args = [rmslash(path) for path in args]
|
||||
return '/'.join(args)
|
||||
|
||||
def create_uri_func_from_context(context, url_scheme_and_hostname):
|
||||
def create_uri(repository_and_namespace, checksum):
|
||||
with context:
|
||||
relative_layer_url = url_for('v2.download_blob', repository=repository_and_namespace,
|
||||
digest=checksum)
|
||||
return urljoin(get_app_url_from_scheme_hostname(url_scheme_and_hostname), relative_layer_url)
|
||||
|
||||
return create_uri
|
||||
|
||||
|
|
Reference in a new issue