Merge pull request #2973 from coreos-inc/joseph.schorr/QS-116/cloudfront-storage

Add support for configuring cloudfront storage
This commit is contained in:
josephschorr 2018-02-02 10:14:28 -05:00 committed by GitHub
commit 6514bf229f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 86 additions and 18 deletions

View file

@ -20,7 +20,7 @@ from endpoints.api import (ApiResource, nickname, resource, internal_only, show_
from endpoints.common import common_login
from util.config.configutil import add_enterprise_config_defaults
from util.config.database import sync_database_with_config
from util.config.validator import validate_service_for_config, CONFIG_FILENAMES
from util.config.validator import validate_service_for_config, is_valid_config_upload_filename
from util.license import decode_license, LicenseDecodeError
import features
@ -319,12 +319,12 @@ class SuperUserConfigFile(ApiResource):
@verify_not_prod
def get(self, filename):
""" Returns whether the configuration file with the given name exists. """
if not filename in CONFIG_FILENAMES:
if not is_valid_config_upload_filename(filename):
abort(404)
if SuperUserPermission().can():
return {
'exists': config_provider.volume_file_exists(filename)
'exists': config_provider.volume_file_exists(filename)
}
abort(403)
@ -333,7 +333,7 @@ class SuperUserConfigFile(ApiResource):
@verify_not_prod
def post(self, filename):
""" Updates the configuration file with the given name. """
if not filename in CONFIG_FILENAMES:
if not is_valid_config_upload_filename(filename):
abort(404)
# Note: This method can be called before the configuration exists