diff --git a/src/manage_nsfs/nsfs_schema_utils.js b/src/manage_nsfs/nsfs_schema_utils.js index 7abbcec9d5..1f4b2efe06 100644 --- a/src/manage_nsfs/nsfs_schema_utils.js +++ b/src/manage_nsfs/nsfs_schema_utils.js @@ -32,6 +32,19 @@ schema_utils.strictify(account_schema, { // NOTE - DO NOT strictify nsfs_config_schema // we might want to use it in the future for adding additional properties +// objects under schema that using ref (with object underneath) - needs to be strictify as well +schema_utils.strictify(common_api.definitions.bucket_policy, { + additionalProperties: false +}); + +schema_utils.strictify(common_api.definitions.bucket_encryption, { + additionalProperties: false +}); + +schema_utils.strictify(common_api.definitions.bucket_website, { + additionalProperties: false +}); + /** * validate_account_schema validates an account object against the NC NSFS account schema * @param {object} account diff --git a/src/test/unit_tests/jest_tests/test_nc_nsfs_bucket_schema_validation.test.js b/src/test/unit_tests/jest_tests/test_nc_nsfs_bucket_schema_validation.test.js index b9e0b86800..7b9e16eeed 100644 --- a/src/test/unit_tests/jest_tests/test_nc_nsfs_bucket_schema_validation.test.js +++ b/src/test/unit_tests/jest_tests/test_nc_nsfs_bucket_schema_validation.test.js @@ -98,7 +98,7 @@ describe('schema validation NC NSFS bucket', () => { // GAP - this test should have passing // currently we can properties to s3_policy which are not part of the schema - it.skip('bucket with my_id inside s3_policy', () => { + it('bucket with my_id inside s3_policy', () => { const bucket_data = get_bucket_data(); bucket_data.s3_policy = bucket_policy1; // added bucket_data.s3_policy.my_id = '123'; // this is not part of the schema @@ -110,7 +110,7 @@ describe('schema validation NC NSFS bucket', () => { // GAP - this test should have passing // currently we can properties to encryption which are not part of the schema - it.skip('bucket with my_id inside encryption', () => { + it('bucket with my_id inside encryption', () => { const bucket_data = get_bucket_data(); bucket_data.encryption = encryption1; // added bucket_data.encryption.my_id = '123'; // this is not part of the schema @@ -122,7 +122,7 @@ describe('schema validation NC NSFS bucket', () => { // GAP - this test should have passing // currently we can properties to website which are not part of the schema - it.skip('bucket with my_id inside website', () => { + it('bucket with my_id inside website', () => { const bucket_data = get_bucket_data(); bucket_data.website = website1; // added bucket_data.website.my_id = '123'; // this is not part of the schema