File tree Expand file tree Collapse file tree
google-cloud-storage/acceptance/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717describe Google ::Cloud ::Storage ::Bucket , :encryption , :storage do
1818 let ( :bucket_name ) { "#{ $bucket_names[ 1 ] } -encryption" }
1919 let ( :bucket_location ) { "us-central1" }
20- let ( :kms_key ) { "projects/helical-zone-771/locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-1" }
21- let ( :kms_key_2 ) { "projects/helical-zone-771/locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-2" }
20+ let ( :kms_key ) {
21+ ENV [ "GCLOUD_TEST_STORAGE_KMS_KEY_1" ] ||
22+ "projects/#{ storage . project_id } /locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-1"
23+ }
24+ let ( :kms_key_2 ) {
25+ ENV [ "GCLOUD_TEST_STORAGE_KMS_KEY_2" ] ||
26+ "projects/#{ storage . project_id } /locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-2"
27+ }
2228 let :bucket do
2329 b = safe_gcs_execute { storage . create_bucket ( bucket_name , location : bucket_location ) }
2430 b . default_kms_key = kms_key
Original file line number Diff line number Diff line change 159159 end
160160
161161 describe "KMS customer-managed encryption key (CMEK)" do
162- let ( :kms_key ) { "projects/helical-zone-771/locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-1" }
163- let ( :kms_key_2 ) { "projects/helical-zone-771/locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-2" }
162+ let ( :kms_key ) {
163+ ENV [ "GCLOUD_TEST_STORAGE_KMS_KEY_1" ] ||
164+ "projects/#{ storage . project_id } /locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-1"
165+ }
166+ let ( :kms_key_2 ) {
167+ ENV [ "GCLOUD_TEST_STORAGE_KMS_KEY_2" ] ||
168+ "projects/#{ storage . project_id } /locations/#{ bucket_location } /keyRings/ruby-test/cryptoKeys/ruby-test-key-2"
169+ }
164170
165171 it "should upload and download a file with default_kms_key" do
166172 bucket . default_kms_key = kms_key
You can’t perform that action at this time.
0 commit comments