diff --git a/etc/swift.conf-sample b/etc/swift.conf-sample index 50c0463bd8..8bb8c4ae5e 100644 --- a/etc/swift.conf-sample +++ b/etc/swift.conf-sample @@ -10,7 +10,8 @@ swift_hash_path_prefix = changeme # The swift-constraints section sets the basic constraints on data -# saved in the swift cluster. +# saved in the swift cluster. These constraints are automatically +# published by the proxy server in responses to /info requests. [swift-constraints] diff --git a/swift/common/constraints.py b/swift/common/constraints.py index 84545fce92..d3cbea0863 100644 --- a/swift/common/constraints.py +++ b/swift/common/constraints.py @@ -34,6 +34,10 @@ MAX_ACCOUNT_NAME_LENGTH = 256 MAX_CONTAINER_NAME_LENGTH = 256 +# If adding an entry to DEFAULT_CONSTRAINTS, note that +# these constraints are automatically published by the +# proxy server in responses to /info requests, with values +# updated by reload_constraints() DEFAULT_CONSTRAINTS = { 'max_file_size': MAX_FILE_SIZE, 'max_meta_name_length': MAX_META_NAME_LENGTH, diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index abd49599a0..3925910612 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -5915,6 +5915,10 @@ def test_registered_defaults(self): constraints.MAX_CONTAINER_NAME_LENGTH) self.assertEqual(si['max_object_name_length'], constraints.MAX_OBJECT_NAME_LENGTH) + self.assertTrue('strict_cors_mode' in si) + # this next test is deliberately brittle in order to alert if + # other items are added to swift info + self.assertEqual(len(si), 13) if __name__ == '__main__':