Skip to content

Commit 4ef2298

Browse files
thiyaguk09quirogas
authored andcommitted
addressing comments
1 parent 08513c2 commit 4ef2298

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

handwritten/storage/system-test/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,7 @@ describe('storage', function () {
30363036
await file.save(FILE_CONTENTS);
30373037

30383038
const [metadata] = await file.getMetadata();
3039-
assert.ok(metadata.kmsKeyName || metadata.customerEncryption);
3039+
assert.ok(metadata.customerEncryption);
30403040
});
30413041

30423042
it('should retain defaultKmsKeyName when updating enforcement settings independently', async () => {

handwritten/storage/test/bucket.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3303,7 +3303,7 @@ describe('Bucket', () => {
33033303

33043304
describe('setMetadata', () => {
33053305
describe('encryption enforcement', () => {
3306-
it('should correctly format restrictionMode for all enforcement types', async () => {
3306+
it('should correctly format restrictionMode for all enforcement types', () => {
33073307
const effectiveTime = '2026-02-02T12:00:00Z';
33083308
const encryptionMetadata = {
33093309
encryption: {
@@ -3365,12 +3365,18 @@ describe('Bucket', () => {
33653365
},
33663366
};
33673367

3368-
bucket.setMetadata = (metadata: BucketMetadata) => {
3369-
assert.strictEqual(
3370-
metadata.encryption?.customerSuppliedEncryptionEnforcementConfig
3371-
?.restrictionMode,
3372-
'FullyRestricted'
3373-
);
3368+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3369+
(bucket as any).request = (reqOpts: {json: BucketMetadata}) => {
3370+
const expectedEncryption = {
3371+
defaultKmsKeyName: 'kms-key-name',
3372+
googleManagedEncryptionEnforcementConfig: {
3373+
restrictionMode: 'FullyRestricted',
3374+
},
3375+
customerSuppliedEncryptionEnforcementConfig: {
3376+
restrictionMode: 'FullyRestricted',
3377+
},
3378+
};
3379+
assert.deepStrictEqual(reqOpts.json.encryption, expectedEncryption);
33743380
done();
33753381
};
33763382

0 commit comments

Comments
 (0)