Merge "s3: Do not log access keys"
This commit is contained in:
@@ -301,8 +301,8 @@ def _update_s3_location_and_store_id(context, loc):
|
|||||||
|
|
||||||
location_map = store_api.location.SCHEME_TO_CLS_BACKEND_MAP
|
location_map = store_api.location.SCHEME_TO_CLS_BACKEND_MAP
|
||||||
if scheme not in location_map:
|
if scheme not in location_map:
|
||||||
LOG.debug("Unknown scheme '%(scheme)s' found in uri '%(uri)s'",
|
LOG.debug("Unknown scheme '%(scheme)s' found in uri",
|
||||||
{'scheme': scheme, 'uri': uri})
|
{'scheme': scheme})
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# URL format: s3://key:secret@host/bucket/object
|
# URL format: s3://key:secret@host/bucket/object
|
||||||
|
|||||||
@@ -1208,9 +1208,10 @@ class S3CredentialUpdateTestCase(test_utils.BaseTestCase):
|
|||||||
# URL should remain unchanged
|
# URL should remain unchanged
|
||||||
self.assertEqual(location['url'], original_url)
|
self.assertEqual(location['url'], original_url)
|
||||||
# Verify that the debug log was called for unknown scheme
|
# Verify that the debug log was called for unknown scheme
|
||||||
|
# Note: URI is not logged for S3 schemes to avoid credential exposure
|
||||||
mock_log.debug.assert_called_once_with(
|
mock_log.debug.assert_called_once_with(
|
||||||
"Unknown scheme '%(scheme)s' found in uri '%(uri)s'",
|
"Unknown scheme '%(scheme)s' found in uri",
|
||||||
{'scheme': 's3', 'uri': 's3://key:secret@bucket/object'})
|
{'scheme': 's3'})
|
||||||
|
|
||||||
@mock.patch('glance.common.store_utils.store_api')
|
@mock.patch('glance.common.store_utils.store_api')
|
||||||
@mock.patch('glance.common.store_utils.CONF')
|
@mock.patch('glance.common.store_utils.CONF')
|
||||||
|
|||||||
Reference in New Issue
Block a user