fog-google 1.25.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/integration-compute-core.yml +2 -2
  3. data/.github/workflows/integration-compute-instance_groups.yml +2 -2
  4. data/.github/workflows/integration-compute-loadbalancing.yml +2 -2
  5. data/.github/workflows/integration-compute-networking.yml +2 -2
  6. data/.github/workflows/integration-monitoring.yml +2 -2
  7. data/.github/workflows/integration-pubsub.yml +2 -2
  8. data/.github/workflows/integration-sql.yml +2 -2
  9. data/.github/workflows/integration-storage.yml +2 -2
  10. data/.github/workflows/unit.yml +2 -2
  11. data/CHANGELOG.md +59 -27
  12. data/SECURITY.md +3 -14
  13. data/fog-google.gemspec +2 -3
  14. data/lib/fog/google/compute/models/disk.rb +11 -0
  15. data/lib/fog/google/compute/models/operation.rb +105 -0
  16. data/lib/fog/google/compute/models/server.rb +1 -1
  17. data/lib/fog/google/storage/storage_json/real.rb +4 -2
  18. data/lib/fog/google/storage/storage_json/utils.rb +4 -2
  19. data/lib/fog/google/storage/storage_xml/real.rb +4 -2
  20. data/lib/fog/google/storage/storage_xml/requests/get_bucket.rb +1 -1
  21. data/lib/fog/google/storage/storage_xml/utils.rb +4 -2
  22. data/lib/fog/google/version.rb +1 -1
  23. metadata +5 -198
  24. data/.github/workflows/stale.yml +0 -23
  25. data/test/helpers/client_helper.rb +0 -63
  26. data/test/helpers/integration_test_helper.rb +0 -108
  27. data/test/helpers/test_collection.rb +0 -60
  28. data/test/helpers/test_helper.rb +0 -28
  29. data/test/integration/compute/core_compute/test_client_options.rb +0 -12
  30. data/test/integration/compute/core_compute/test_coverage.rb +0 -6
  31. data/test/integration/compute/core_compute/test_disk_types.rb +0 -43
  32. data/test/integration/compute/core_compute/test_disks.rb +0 -53
  33. data/test/integration/compute/core_compute/test_images.rb +0 -32
  34. data/test/integration/compute/core_compute/test_machine_types.rb +0 -55
  35. data/test/integration/compute/core_compute/test_operations.rb +0 -45
  36. data/test/integration/compute/core_compute/test_projects.rb +0 -19
  37. data/test/integration/compute/core_compute/test_regions.rb +0 -33
  38. data/test/integration/compute/core_compute/test_servers.rb +0 -235
  39. data/test/integration/compute/core_compute/test_snapshots.rb +0 -21
  40. data/test/integration/compute/core_compute/test_zones.rb +0 -35
  41. data/test/integration/compute/core_networking/test_addresses.rb +0 -107
  42. data/test/integration/compute/core_networking/test_coverage.rb +0 -6
  43. data/test/integration/compute/core_networking/test_firewalls.rb +0 -11
  44. data/test/integration/compute/core_networking/test_networks.rb +0 -30
  45. data/test/integration/compute/core_networking/test_routes.rb +0 -26
  46. data/test/integration/compute/core_networking/test_subnetworks.rb +0 -11
  47. data/test/integration/compute/instance_groups/test_coverage.rb +0 -6
  48. data/test/integration/compute/instance_groups/test_instance_group_managers.rb +0 -11
  49. data/test/integration/compute/instance_groups/test_instance_groups.rb +0 -11
  50. data/test/integration/compute/instance_groups/test_instance_templates.rb +0 -11
  51. data/test/integration/compute/loadbalancing/test_backend_services.rb +0 -11
  52. data/test/integration/compute/loadbalancing/test_coverage.rb +0 -6
  53. data/test/integration/compute/loadbalancing/test_forwarding_rules.rb +0 -11
  54. data/test/integration/compute/loadbalancing/test_global_addresses.rb +0 -11
  55. data/test/integration/compute/loadbalancing/test_global_forwarding_rules.rb +0 -11
  56. data/test/integration/compute/loadbalancing/test_http_health_checks.rb +0 -11
  57. data/test/integration/compute/loadbalancing/test_ssl_certificates.rb +0 -11
  58. data/test/integration/compute/loadbalancing/test_target_http_proxies.rb +0 -11
  59. data/test/integration/compute/loadbalancing/test_target_https_proxies.rb +0 -11
  60. data/test/integration/compute/loadbalancing/test_target_instances.rb +0 -11
  61. data/test/integration/compute/loadbalancing/test_target_pools.rb +0 -55
  62. data/test/integration/compute/loadbalancing/test_url_maps.rb +0 -11
  63. data/test/integration/factories/addresses_factory.rb +0 -20
  64. data/test/integration/factories/backend_services_factory.rb +0 -19
  65. data/test/integration/factories/collection_factory.rb +0 -52
  66. data/test/integration/factories/disks_factory.rb +0 -22
  67. data/test/integration/factories/firewalls_factory.rb +0 -13
  68. data/test/integration/factories/forwarding_rules_factory.rb +0 -25
  69. data/test/integration/factories/global_addresses_factory.rb +0 -15
  70. data/test/integration/factories/global_forwarding_rules_factory.rb +0 -20
  71. data/test/integration/factories/http_health_checks_factory.rb +0 -11
  72. data/test/integration/factories/images_factory.rb +0 -16
  73. data/test/integration/factories/instance_group_manager_factory.rb +0 -30
  74. data/test/integration/factories/instance_groups_factory.rb +0 -20
  75. data/test/integration/factories/instance_template_factory.rb +0 -24
  76. data/test/integration/factories/networks_factory.rb +0 -14
  77. data/test/integration/factories/servers_factory.rb +0 -30
  78. data/test/integration/factories/sql_certs_factory.rb +0 -20
  79. data/test/integration/factories/sql_instances_factory.rb +0 -19
  80. data/test/integration/factories/sql_users_factory.rb +0 -23
  81. data/test/integration/factories/ssl_certificates_factory.rb +0 -13
  82. data/test/integration/factories/subnetworks_factory.rb +0 -26
  83. data/test/integration/factories/target_http_proxies_factory.rb +0 -19
  84. data/test/integration/factories/target_https_proxies_factory.rb +0 -26
  85. data/test/integration/factories/target_instances_factory.rb +0 -24
  86. data/test/integration/factories/target_pools_factory.rb +0 -28
  87. data/test/integration/factories/url_maps_factory.rb +0 -19
  88. data/test/integration/monitoring/test_coverage.rb +0 -6
  89. data/test/integration/monitoring/test_metric_descriptors.rb +0 -131
  90. data/test/integration/monitoring/test_monitored_resource_descriptors.rb +0 -37
  91. data/test/integration/monitoring/test_timeseries.rb +0 -253
  92. data/test/integration/pubsub/pubsub_shared.rb +0 -75
  93. data/test/integration/pubsub/test_coverage.rb +0 -6
  94. data/test/integration/pubsub/test_pubsub_models.rb +0 -135
  95. data/test/integration/pubsub/test_pubsub_requests.rb +0 -105
  96. data/test/integration/sql/test_certs.rb +0 -50
  97. data/test/integration/sql/test_common_flags.rb +0 -31
  98. data/test/integration/sql/test_common_tiers.rb +0 -26
  99. data/test/integration/sql/test_coverage.rb +0 -6
  100. data/test/integration/sql/test_instances.rb +0 -101
  101. data/test/integration/sql/test_users.rb +0 -37
  102. data/test/integration/storage/storage_shared.rb +0 -101
  103. data/test/integration/storage/test_buckets.rb +0 -112
  104. data/test/integration/storage/test_coverage.rb +0 -6
  105. data/test/integration/storage/test_directories.rb +0 -67
  106. data/test/integration/storage/test_files.rb +0 -168
  107. data/test/integration/storage/test_objects.rb +0 -226
  108. data/test/integration/test_authentication.rb +0 -38
  109. data/test/unit/compute/test_common_collections.rb +0 -42
  110. data/test/unit/compute/test_common_models.rb +0 -35
  111. data/test/unit/compute/test_disk.rb +0 -26
  112. data/test/unit/compute/test_server.rb +0 -29
  113. data/test/unit/dns/test_common_collections.rb +0 -43
  114. data/test/unit/monitoring/test_comon_collections.rb +0 -44
  115. data/test/unit/pubsub/test_common_collections.rb +0 -35
  116. data/test/unit/sql/test_common_collections.rb +0 -46
  117. data/test/unit/storage/test_common_json_collections.rb +0 -38
  118. data/test/unit/storage/test_common_xml_collections.rb +0 -50
  119. data/test/unit/storage/test_json_requests.rb +0 -60
  120. data/test/unit/storage/test_xml_requests.rb +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87a715866f44c0d1a77d6a2d9eb1c86b9eb1b2ad1926b48ca8f33bff6729f038
4
- data.tar.gz: 9d0af9d669834f9859b2a5c1d0b12a377fdc11cc8bcdad1d14a58068f00f1c35
3
+ metadata.gz: 324898488d484b7d2bf5e875ebe152c545607044090f4786941f8106754b4433
4
+ data.tar.gz: ae49e89d5e42127efde49e52340e751e1c075f100fe19b03e5bc3c88399a2e99
5
5
  SHA512:
6
- metadata.gz: 556ef7cd9ca3e7c33308c9fd8e668f98284fdf7aecbd17c1ceeef2a317b324c2f4cd8e6cd6201fd95507c9a74960d2318dbbf6c6d173cf246d8491367a578523
7
- data.tar.gz: 7c00ced8d78888a448c83ee5582580fe10c970aab34dd7d84e52961b8fb796e8d6cf1a776ca704542cd6618b5fdbb591c12bff42014e4389862522da08311db3
6
+ metadata.gz: 56f151cbc7b3b170b90537b26410517f29c769ca6168fbc16bdd9937e89bfc44c315da223cf7dfae916775626c985b67db07c9e15aacfcb8e6a69d8f082a23b3
7
+ data.tar.gz: 3a44a91f409c99d4caa368bc6d8f30e131f6cb566e66926b9bec27a9a25aa4b453b2bb27a5526f1420553a06caa569520712962fd8011d842f82bc2ab1926201
@@ -36,13 +36,13 @@ jobs:
36
36
  runs-on: fog-arc-runner
37
37
  strategy:
38
38
  matrix:
39
- ruby-version: [ '3.0', '3.1', '3.2' ]
39
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
40
  # Integration tests from the same task cannot run in parallel yet due to cleanup
41
41
  # TODO(fog-google#626): remove this once cleanup is fixed
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -37,12 +37,12 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2' ]
40
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -37,12 +37,12 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2' ]
40
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -36,12 +36,12 @@ jobs:
36
36
  runs-on: fog-arc-runner
37
37
  strategy:
38
38
  matrix:
39
- ruby-version: [ '3.0', '3.1', '3.2' ]
39
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
40
  # Integration tests from the same task cannot run in parallel yet due to cleanup
41
41
  max-parallel: 1
42
42
 
43
43
  steps:
44
- - uses: actions/checkout@v4
44
+ - uses: actions/checkout@v6
45
45
  - name: Set up Ruby
46
46
  uses: ruby/setup-ruby@v1
47
47
  with:
@@ -37,12 +37,12 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2' ]
40
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -37,12 +37,12 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2' ]
40
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -37,12 +37,12 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2' ]
40
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
44
44
  steps:
45
- - uses: actions/checkout@v4
45
+ - uses: actions/checkout@v6
46
46
  - name: Set up Ruby
47
47
  uses: ruby/setup-ruby@v1
48
48
  with:
@@ -38,12 +38,12 @@ jobs:
38
38
  runs-on: fog-arc-runner
39
39
  strategy:
40
40
  matrix:
41
- ruby-version: [ '3.0', '3.1', '3.2' ]
41
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
42
42
  # Integration tests from the same task cannot run in parallel yet due to cleanup
43
43
  max-parallel: 1
44
44
 
45
45
  steps:
46
- - uses: actions/checkout@v4
46
+ - uses: actions/checkout@v6
47
47
  - name: Set up Ruby
48
48
  uses: ruby/setup-ruby@v1
49
49
  with:
@@ -16,10 +16,10 @@ jobs:
16
16
  runs-on: ubuntu-latest
17
17
  strategy:
18
18
  matrix:
19
- ruby-version: [ '3.0', '3.1', '3.2', 'head', 'truffleruby-head']
19
+ ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4', 'head', 'truffleruby-head']
20
20
 
21
21
  steps:
22
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@v6
23
23
  - name: Set up Ruby
24
24
  uses: ruby/setup-ruby@v1
25
25
  with:
data/CHANGELOG.md CHANGED
@@ -4,10 +4,42 @@ The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1
4
4
 
5
5
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## Next
7
+ ## 1.27.0
8
8
 
9
9
  ### User-facing
10
10
 
11
+ ### Fixed
12
+
13
+ - #648 raise exception if disk quota exceeded [rchekaluk]
14
+
15
+ ### Development changes
16
+
17
+ - #647 bump actions/checkout from 5 to 6 [dependabot]
18
+ - #649 bump pry from = 0.15.2 to = 0.16.0 [dependabot]
19
+
20
+ ## 1.26.0
21
+
22
+ ### User-facing
23
+
24
+ #### Fixed
25
+
26
+ - #632 remove unused files from package [temikus]
27
+ - #643 update disk attachment method to use new attached_disk_obj method [geemus]
28
+ - #644 improve mock bucket name regex validation [geemus]
29
+ - #646 fix frozen string literal warnings in storage [krororo]
30
+
31
+ ### Development changes
32
+
33
+ #### Added
34
+
35
+ - #645 add ruby 3.3 and 3.4 to CI test matrix [krororo]
36
+
37
+ #### Fixed
38
+
39
+ - #641 Updated actions/checkout from 4 to 5 [dependabot]
40
+ - #642 Updated actions/stale from 9 to 10 [dependabot]
41
+ - remove stale workflow [geemus]
42
+
11
43
  ## 1.25.0
12
44
 
13
45
  ### User-facing
@@ -335,7 +367,7 @@ Drop travis usage
335
367
 
336
368
  #### Fixed
337
369
 
338
- - \#448 Add `:google_application_default` as recognized argument in
370
+ - \#448 Add `:google_application_default` as recognized argument in
339
371
  Fog::Compute::Google client [mavin]
340
372
 
341
373
  ### Development changes
@@ -351,14 +383,14 @@ Drop travis usage
351
383
  #### Added
352
384
 
353
385
  - \#442 Add support for Application Default credentials [mavin]
354
- - This change allows the use of Application Default Credentials so that end
386
+ - This change allows the use of Application Default Credentials so that end
355
387
  users can authenticate without a service account for development, testing,
356
- and one-off interactions by using `:google_application_default`client
388
+ and one-off interactions by using `:google_application_default`client
357
389
  option. See README for more details.
358
390
 
359
391
  ### Fixed
360
392
 
361
- - \#444 Remove deprecated `google_client_email` option from client parameters
393
+ - \#444 Remove deprecated `google_client_email` option from client parameters
362
394
  [temikus]
363
395
  - \#446 Updating service parameters to avoid "unrecognised parameter" warnings
364
396
  when initializing Fog client with application default auth [temikus]
@@ -383,7 +415,7 @@ Drop travis usage
383
415
 
384
416
  #### Fixed
385
417
 
386
- - \#433 Allow the api to close Tempfiles inline, improving disk utilization.
418
+ - \#433 Allow the api to close Tempfiles inline, improving disk utilization.
387
419
  [itopalov]
388
420
 
389
421
  ### Development changes
@@ -425,12 +457,12 @@ Drop travis usage
425
457
  - \#419 Locked down fog upstream dependencies to alleviate deprecation warnings
426
458
  until they can be properly dealt with. [temikus]
427
459
  - \#400 Small `%Collection%.get` and `%Collection%.all` behaviour fixes [temikus]
428
- - `Fog::Google::SQL::Instances.get(nil)` no longer returns an invalid
460
+ - `Fog::Google::SQL::Instances.get(nil)` no longer returns an invalid
429
461
  `sql#instancesList` object.
430
- - `Fog::Compute::Google::InstanceGroups.get` and `.all` methods now support
462
+ - `Fog::Compute::Google::InstanceGroups.get` and `.all` methods now support
431
463
  more than just `:filter` option, fixed `.all` output without `zone` option.
432
464
  - Fix a typo causing `Operations.get(region:REGION)` to fail.
433
- - `Fog::Compute::Google::Images.get(IMAGE, PROJECT)`, now returns `nil` if
465
+ - `Fog::Compute::Google::Images.get(IMAGE, PROJECT)`, now returns `nil` if
434
466
  image is not found rather than throwing `Google::Apis::ClientError`.
435
467
 
436
468
  ### Development changes
@@ -438,13 +470,13 @@ Drop travis usage
438
470
  #### Added
439
471
 
440
472
  - \#400 Additional test coverage [temikus]
441
- - Expanded tests for `%Collection%.get` behavior - scoped requests
442
- (e.g. `get(zone:ZONE)`) and their corresponding code paths are now also
473
+ - Expanded tests for `%Collection%.get` behavior - scoped requests
474
+ (e.g. `get(zone:ZONE)`) and their corresponding code paths are now also
443
475
  properly tested.
444
476
  - Increase `Fog::Compute::Google::Images` integration test coverage.
445
477
  - Unit tests now work without a `~/.fog` config file set up.
446
478
  - Expanded unit test coverage.
447
- - \#424 Add simple integration tests to check client proxy options being
479
+ - \#424 Add simple integration tests to check client proxy options being
448
480
  applied.
449
481
 
450
482
  #### Changed
@@ -461,7 +493,7 @@ Drop travis usage
461
493
 
462
494
  #### Fixed
463
495
 
464
- - \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url`
496
+ - \#412 Fixed `Fog::Storage::GoogleXML::GetObjectHttpUrl#get_object_http_url`
465
497
  request
466
498
 
467
499
  ## 1.7.0
@@ -478,8 +510,8 @@ Drop travis usage
478
510
 
479
511
  #### Changed
480
512
 
481
- - \#394 `save/update/destroy` and other operations now wait until they are in a
482
- DONE state, instead of !PENDING. This should be a no-op for users but should
513
+ - \#394 `save/update/destroy` and other operations now wait until they are in a
514
+ DONE state, instead of !PENDING. This should be a no-op for users but should
483
515
  safeguard from issues in the future. [temikus]
484
516
  - \#383 `Fog::Compute::Google::Address` resources are now created synchronously
485
517
  by default. [temikus]
@@ -497,7 +529,7 @@ Drop travis usage
497
529
  - \#376 Add doc coverage tracking. [temikus]
498
530
  - \#383 Increase integration test coverage further. [temikus]
499
531
  - Add collection tests and factories (when mutable) for following resources:
500
- - Addresses
532
+ - Addresses
501
533
  - Disks
502
534
  - Projects
503
535
  - Routes
@@ -521,7 +553,7 @@ Drop travis usage
521
553
 
522
554
  #### Changed
523
555
 
524
- - \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default.
556
+ - \#338 `Fog::Google::SQL` resources are now created and destroyed synchronously by default.
525
557
  You can override it in a standard manner by passing a parameter to async method, e.g.:
526
558
  `Fog::Google::SQL::Instance.create(true)` [temikus]
527
559
  - \#367 `Fog::Compute::Google::Server.bootstrap` changes [temikus]
@@ -590,30 +622,30 @@ You can override it in a standard manner by passing a parameter to async method,
590
622
  #### Added
591
623
 
592
624
  - \#336 `Fog::Compute::Google::Server.set_metadata` is now working properly and adopted a simpler format, e.g. `{'foo' => 'bar', 'baz'=>'foo'}`
593
- - \#334 Added a new helper method: `Fog::Compute::Google::Server.public_ip_address` [temikus]
594
- - \#314 Added `Fog::Compute::Google::InstanceGroup.add_instance` method back [temikus]
625
+ - \#334 Added a new helper method: `Fog::Compute::Google::Server.public_ip_address` [temikus]
626
+ - \#314 Added `Fog::Compute::Google::InstanceGroup.add_instance` method back [temikus]
595
627
  - \#326 Added support for using predefined ACLs, refactor valid ACLs [vimutter]
596
628
  - \#318 Added fog_public support in Storage JSON API [jayhsu21]
597
629
 
598
630
  #### Fixed
599
631
 
600
- - \#354 Bump Google API client to 0.23 [temikus]
601
- - \#346 Fixed get_health when called with an instance name [bpaquet]
602
- - \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus]
603
- - \#321 Fix string key instead of symbol for subnetworks listing [tumido]
604
- - \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter]
632
+ - \#354 Bump Google API client to 0.23 [temikus]
633
+ - \#346 Fixed get_health when called with an instance name [bpaquet]
634
+ - \#317 Fixed source_image selection to get the image from name if the format is not compatible with new Google API Client [temikus]
635
+ - \#321 Fix string key instead of symbol for subnetworks listing [tumido]
636
+ - \#351 Fixed trailing spaces and added data presence check to `Fog::Storage::GoogleJSON.put_object` [vimutter]
605
637
 
606
638
  ### Development changes
607
639
 
608
640
  #### Added
609
641
 
610
- - \#353 Added collection/model unit tests to be run by Travis CI [temikus]
611
- - \#347 Added target pool tests [temikus]
642
+ - \#353 Added collection/model unit tests to be run by Travis CI [temikus]
643
+ - \#347 Added target pool tests [temikus]
612
644
 
613
645
  #### Fixed
614
646
 
615
647
  - \#322 Fixed all broken integration tests, all tests now pass in CI [temikus]
616
- - \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus]
648
+ - \#344 Updated CI pipeline to run in parallel, broke out test tasks [temikus]
617
649
 
618
650
  ## 1.0.1
619
651
 
data/SECURITY.md CHANGED
@@ -1,16 +1,5 @@
1
- # Security Policy
1
+ # Security contact information
2
2
 
3
- Our README.md is the end all be all for authoritative information, but the following is our security policy.
3
+ To report a security vulnerability, please contact [Tidelift security](https://tidelift.com/security).
4
4
 
5
- ## Supported Versions
6
-
7
- Versions with :white_check_mark: are supported. All other versions need to be upgraded.
8
-
9
- | Version | Supported |
10
- | ------- | ------------------ |
11
- | 1.9.x | :white_check_mark: |
12
- | 0.1.x | :white_check_mark: until July 1st, 2019 |
13
-
14
- ## Reporting a Vulnerability
15
-
16
- Please file an issue here to report a vulnerability. For immediate escalations, please email nat@natwelch.com and temikus@google.com with the subject `[Fog-Google Security Issue] Description`.
5
+ Tidelift will coordinate the fix and disclosure.
data/fog-google.gemspec CHANGED
@@ -12,9 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/fog/fog-google"
13
13
  spec.license = "MIT"
14
14
 
15
- spec.files = `git ls-files -z`.split("\x0")
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?("test/") }
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
17
  spec.require_paths = ["lib"]
19
18
 
20
19
  # As of 0.1.1
@@ -39,7 +38,7 @@ Gem::Specification.new do |spec|
39
38
  # Debugger
40
39
  # Locked because pry-byebug is broken with 13+
41
40
  # see: https://github.com/deivid-rodriguez/pry-byebug/issues/343
42
- spec.add_development_dependency "pry", "= 0.14.2"
41
+ spec.add_development_dependency "pry", "= 0.16.0"
43
42
 
44
43
  # Testing gems
45
44
  spec.add_development_dependency "retriable"
@@ -55,6 +55,17 @@ module Fog
55
55
  operation = Fog::Google::Compute::Operations.new(service: service)
56
56
  .get(data.name, data.zone)
57
57
  operation.wait_for { ready? }
58
+
59
+ # Handle errors
60
+ if operation.error?
61
+ msg = "Error creating disk #{name} size #{size_gb}."
62
+
63
+ err = operation.primary_error
64
+ msg = "#{msg} #{err.message_pretty}" unless err.nil?
65
+
66
+ raise Fog::Errors::Error.new(msg)
67
+ end
68
+
58
69
  reload
59
70
  end
60
71
 
@@ -26,6 +26,82 @@ module Fog
26
26
  attribute :warnings
27
27
  attribute :zone
28
28
 
29
+
30
+ # {:errors=>
31
+ # [{:code=>"QUOTA_EXCEEDED",
32
+ # :error_details=>
33
+ # [{:quota_info=>
34
+ # {:dimensions=>{:region=>"us-east4"},
35
+ # :limit=>500,
36
+ # :limit_name=>"SSD-TOTAL-GB-per-project-region",
37
+ # :metric_name=>"compute.googleapis.com/ssd_total_storage"}}],
38
+ # :message=>"Quota 'SSD_TOTAL_GB' exceeded. Limit: 500.0 in region us-east4."}
39
+ # ]
40
+ # }
41
+ class ErrorInfo
42
+ attr_accessor :code
43
+ attr_accessor :error_details
44
+ attr_accessor :location
45
+ attr_accessor :message
46
+
47
+ def initialize(attributes = {})
48
+ @code = attributes[:code]
49
+ @error_details = attributes[:error_details]
50
+ @location = attributes[:location]
51
+ @message = attributes[:message]
52
+ end
53
+
54
+ def message_pretty
55
+ message
56
+ end
57
+ end # ErrorInfo
58
+
59
+ class QuotaInfo < ErrorInfo
60
+ def initialize(attributes = {})
61
+ code = attributes[:code]
62
+ raise Fog::Errors::Error.new("Invalid error code: #{code}") if code != "QUOTA_EXCEEDED"
63
+
64
+ super(attributes)
65
+ end
66
+
67
+ def quota_infos
68
+ return [] unless error_details.is_a?(Array)
69
+
70
+ error_details_quota_infos = error_details.select{|ed| ed.is_a?(Hash) && ed.has_key?(:quota_info)}
71
+ error_details_quota_infos.map{|ed| ed[:quota_info]}
72
+ end
73
+
74
+ def message_pretty
75
+ msg = super.gsub(/\s*Limit.*region.*[^.]+./, "")
76
+
77
+ quota_infos.each do |qi|
78
+ dimensions = qi[:dimensions] if qi.is_a?(Hash)
79
+ limit = qi[:limit] if qi.is_a?(Hash)
80
+ metric = qi[:metric_name] if qi.is_a?(Hash)
81
+
82
+ region = dimensions[:region] if dimensions.is_a?(Hash)
83
+
84
+ limit_msg = " Limit: #{limit.to_f}" if limit.is_a?(Numeric)
85
+ limit_msg = "#{limit_msg} #{metric}" if limit_msg && metric
86
+ limit_msg = "#{limit_msg} in region #{region}" if limit_msg && region.is_a?(String)
87
+ limit_msg = "#{limit_msg}." if limit_msg
88
+
89
+ msg = "#{msg}#{limit_msg}"
90
+ end
91
+
92
+ msg
93
+ end
94
+ end # QuotaInfo
95
+
96
+
97
+ def error?
98
+ ! error.nil?
99
+ end
100
+
101
+ def errors
102
+ error? ? error[:errors] : nil
103
+ end
104
+
29
105
  def ready?
30
106
  status == DONE_STATE
31
107
  end
@@ -42,6 +118,35 @@ module Fog
42
118
  zone.nil? ? nil : zone.split("/")[-1]
43
119
  end
44
120
 
121
+ def error_info_class(code)
122
+ case code
123
+ when "QUOTA_EXCEEDED" then QuotaInfo
124
+ else
125
+ ErrorInfo
126
+ end
127
+ end
128
+
129
+ # Returns an array of ErrorInfo objects derived from the raw error hash.
130
+ def error_infos
131
+ return [] unless error.is_a?(Hash)
132
+ return [] unless errors.is_a?(Array)
133
+
134
+ errors.map do |err|
135
+ klass = error_info_class(err[:code])
136
+ klass.new(
137
+ code: err[:code],
138
+ message: err[:message],
139
+ location: err[:location],
140
+ error_details: err[:error_details]
141
+ )
142
+ end
143
+ end
144
+
145
+ # Convenience helper: return the first error (most Google APIs provide only one).
146
+ def primary_error
147
+ error_infos.first
148
+ end
149
+
45
150
  def destroy
46
151
  requires :identity
47
152
 
@@ -277,7 +277,7 @@ module Fog
277
277
  requires :identity, :zone
278
278
 
279
279
  if disk.is_a? Disk
280
- disk_obj = disk.get_attached_disk
280
+ disk_obj = disk.attached_disk_obj(**attached_disk_options)
281
281
  elsif disk.is_a? String
282
282
  disk_obj = service.disks.attached_disk_obj(disk, **attached_disk_options)
283
283
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fog
2
4
  module Google
3
5
  class StorageJSON
@@ -34,7 +36,7 @@ module Fog
34
36
  DATA
35
37
 
36
38
  google_headers = {}
37
- canonical_google_headers = ""
39
+ canonical_google_headers = +""
38
40
  params[:headers].each do |key, value|
39
41
  google_headers[key] = value if key[0..6] == "x-goog-"
40
42
  end
@@ -45,7 +47,7 @@ DATA
45
47
  end
46
48
  string_to_sign << canonical_google_headers.to_s
47
49
 
48
- canonical_resource = "/"
50
+ canonical_resource = +"/"
49
51
  if subdomain = params.delete(:subdomain)
50
52
  canonical_resource << "#{CGI.escape(subdomain).downcase}/"
51
53
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "addressable"
2
4
 
3
5
  module Fog
@@ -5,11 +7,11 @@ module Fog
5
7
  class StorageJSON
6
8
  module Utils
7
9
  def http_url(params, expires)
8
- "http://" << host_path_query(params, expires)
10
+ "http://#{host_path_query(params, expires)}"
9
11
  end
10
12
 
11
13
  def https_url(params, expires)
12
- "https://" << host_path_query(params, expires)
14
+ "https://#{host_path_query(params, expires)}"
13
15
  end
14
16
 
15
17
  def url(params, expires)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fog
2
4
  module Google
3
5
  class StorageXML
@@ -46,7 +48,7 @@ module Fog
46
48
  DATA
47
49
 
48
50
  google_headers = {}
49
- canonical_google_headers = ""
51
+ canonical_google_headers = +""
50
52
  params[:headers].each do |key, value|
51
53
  google_headers[key] = value if key[0..6] == "x-goog-"
52
54
  end
@@ -57,7 +59,7 @@ DATA
57
59
  end
58
60
  string_to_sign << canonical_google_headers.to_s
59
61
 
60
- canonical_resource = "/"
62
+ canonical_resource = +"/"
61
63
  if subdomain = params.delete(:subdomain)
62
64
  canonical_resource << "#{CGI.escape(subdomain).downcase}/"
63
65
  end
@@ -49,7 +49,7 @@ module Fog
49
49
  def get_bucket(bucket_name, options = {})
50
50
  raise ArgumentError.new("bucket_name is required") unless bucket_name
51
51
  response = Excon::Response.new
52
- name = /(\w+\.?)*/.match(bucket_name)
52
+ name = /([a-zA-Z0-9][a-zA-Z0-9\-_.]+[a-zA-Z0-9])/.match(bucket_name)
53
53
  if bucket_name == name.to_s
54
54
  if bucket = data[:buckets][bucket_name]
55
55
  contents = bucket[:objects].values.sort_by { |a| a["Key"] }.reject do |object|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fog
2
4
  module Google
3
5
  class StorageXML
@@ -14,11 +16,11 @@ module Fog
14
16
  ).freeze
15
17
 
16
18
  def http_url(params, expires)
17
- "http://" << host_path_query(params, expires)
19
+ "http://#{host_path_query(params, expires)}"
18
20
  end
19
21
 
20
22
  def https_url(params, expires)
21
- "https://" << host_path_query(params, expires)
23
+ "https://#{host_path_query(params, expires)}"
22
24
  end
23
25
 
24
26
  def url(params, expires)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.25.0".freeze
3
+ VERSION = "1.27.0".freeze
4
4
  end
5
5
  end