@@ -70,9 +70,17 @@ it('should set bucket encryption enforcement configuration', async () => {
7070 assert . match ( output , new RegExp ( 'Effective:' ) ) ;
7171
7272 const [ metadata ] = await bucket . getMetadata ( ) ;
73+ const encryption = metadata . encryption || { } ;
7374 assert . strictEqual (
74- metadata . encryption . googleManagedEncryptionEnforcementConfig
75- . restrictionMode ,
75+ encryption . googleManagedEncryptionEnforcementConfig ?. restrictionMode ,
76+ 'FullyRestricted'
77+ ) ;
78+ assert . strictEqual (
79+ encryption . customerManagedEncryptionEnforcementConfig ?. restrictionMode ,
80+ 'NotRestricted'
81+ ) ;
82+ assert . strictEqual (
83+ encryption . customerSuppliedEncryptionEnforcementConfig ?. restrictionMode ,
7684 'FullyRestricted'
7785 ) ;
7886} ) ;
@@ -91,6 +99,23 @@ it('should get bucket encryption enforcement configuration', async () => {
9199 assert . include ( output , 'Google Managed (GMEK) Enforcement:' ) ;
92100 assert . include ( output , 'Mode: FullyRestricted' ) ;
93101 assert . match ( output , / E f f e c t i v e : / ) ;
102+
103+ const [ metadata ] = await bucket . getMetadata ( ) ;
104+ const encryption = metadata . encryption || { } ;
105+
106+ assert . strictEqual ( encryption . defaultKmsKeyName , defaultKmsKeyName ) ;
107+ assert . strictEqual (
108+ encryption . googleManagedEncryptionEnforcementConfig ?. restrictionMode ,
109+ 'FullyRestricted'
110+ ) ;
111+ assert . strictEqual (
112+ encryption . customerManagedEncryptionEnforcementConfig ?. restrictionMode ,
113+ 'NotRestricted'
114+ ) ;
115+ assert . strictEqual (
116+ encryption . customerSuppliedEncryptionEnforcementConfig ?. restrictionMode ,
117+ 'FullyRestricted'
118+ ) ;
94119} ) ;
95120
96121it ( 'should update and then remove bucket encryption enforcement configuration' , async ( ) => {
0 commit comments