Allow Glacier VaultName to contain period (#3964)

This commit is contained in:
Brian Pandola 2021-05-27 00:44:20 -07:00 committed by GitHub
parent 6adb570c48
commit 3265e89fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -5,7 +5,7 @@ url_bases = ["https?://glacier.(.+).amazonaws.com"]
url_paths = {
"{0}/(?P<account_number>.+)/vaults$": GlacierResponse.all_vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/.]+)$": GlacierResponse.vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/]+)$": GlacierResponse.vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>.+)/archives$": GlacierResponse.vault_archive_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>.+)/archives/(?P<archive_id>.+)$": GlacierResponse.vault_archive_individual_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>.+)/jobs$": GlacierResponse.vault_jobs_response,

View File

@ -1,9 +1,10 @@
from __future__ import unicode_literals
import boto.glacier
import boto3
import sure # noqa
from moto import mock_glacier_deprecated
from moto import mock_glacier_deprecated, mock_glacier
@mock_glacier_deprecated
@ -29,3 +30,11 @@ def test_delete_vault():
conn.delete_vault("my_vault")
vaults = conn.list_vaults()
vaults.should.have.length_of(0)
@mock_glacier
def test_vault_name_with_special_characters():
vault_name = "Vault.name-with_Special.characters"
glacier = boto3.resource("glacier", region_name="us-west-2")
vault = glacier.create_vault(accountId="-", vaultName=vault_name)
vault.name.should.equal(vault_name)