scalingo 3.3.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dependabot.yml +17 -0
  3. data/.github/workflows/publish.yml +6 -3
  4. data/.github/workflows/ruby.yml +3 -3
  5. data/.rubocop.yml +9 -21
  6. data/CHANGELOG.md +10 -0
  7. data/README.md +1 -1
  8. data/lib/scalingo/api/client.rb +6 -15
  9. data/lib/scalingo/api/response.rb +3 -3
  10. data/lib/scalingo/auth/tokens.rb +2 -2
  11. data/lib/scalingo/auth.rb +1 -1
  12. data/lib/scalingo/billing.rb +1 -1
  13. data/lib/scalingo/client.rb +6 -6
  14. data/lib/scalingo/configuration.rb +3 -3
  15. data/lib/scalingo/core_client.rb +2 -3
  16. data/lib/scalingo/regional/addons.rb +1 -1
  17. data/lib/scalingo/regional.rb +1 -1
  18. data/lib/scalingo/regional_database/databases.rb +13 -0
  19. data/lib/scalingo/regional_database.rb +1 -1
  20. data/lib/scalingo/token_holder.rb +1 -1
  21. data/lib/scalingo/version.rb +1 -1
  22. data/samples/regional_database/backups/_meta.json +1 -1
  23. data/samples/regional_database/backups/archive-200.json +2 -2
  24. data/samples/regional_database/backups/archive-400.json +1 -1
  25. data/samples/regional_database/backups/create-201.json +1 -1
  26. data/samples/regional_database/backups/create-400.json +1 -1
  27. data/samples/regional_database/backups/for-200.json +1 -1
  28. data/samples/regional_database/backups/for-400.json +1 -1
  29. data/samples/regional_database/databases/_meta.json +1 -1
  30. data/samples/regional_database/databases/find-200.json +5 -3
  31. data/samples/regional_database/databases/find-400.json +1 -1
  32. data/samples/regional_database/databases/upgrade-202.json +39 -0
  33. data/samples/regional_database/databases/upgrade-400.json +24 -0
  34. data/scalingo.gemspec +4 -7
  35. metadata +13 -92
  36. data/spec/scalingo/api/client_spec.rb +0 -256
  37. data/spec/scalingo/api/endpoint_spec.rb +0 -45
  38. data/spec/scalingo/api/response_spec.rb +0 -301
  39. data/spec/scalingo/auth/keys_spec.rb +0 -58
  40. data/spec/scalingo/auth/scm_integrations_spec.rb +0 -58
  41. data/spec/scalingo/auth/tokens_spec.rb +0 -74
  42. data/spec/scalingo/auth/two_factor_auth_spec.rb +0 -69
  43. data/spec/scalingo/auth/user_spec.rb +0 -31
  44. data/spec/scalingo/auth_spec.rb +0 -15
  45. data/spec/scalingo/bearer_token_spec.rb +0 -72
  46. data/spec/scalingo/billing/profile_spec.rb +0 -55
  47. data/spec/scalingo/billing_spec.rb +0 -11
  48. data/spec/scalingo/client_spec.rb +0 -93
  49. data/spec/scalingo/configuration_spec.rb +0 -57
  50. data/spec/scalingo/core_client_spec.rb +0 -23
  51. data/spec/scalingo/regional/addons_spec.rb +0 -169
  52. data/spec/scalingo/regional/apps_spec.rb +0 -137
  53. data/spec/scalingo/regional/autoscalers_spec.rb +0 -84
  54. data/spec/scalingo/regional/collaborators_spec.rb +0 -69
  55. data/spec/scalingo/regional/containers_spec.rb +0 -67
  56. data/spec/scalingo/regional/deployments_spec.rb +0 -45
  57. data/spec/scalingo/regional/domains_spec.rb +0 -84
  58. data/spec/scalingo/regional/environment_spec.rb +0 -77
  59. data/spec/scalingo/regional/events_spec.rb +0 -65
  60. data/spec/scalingo/regional/logs_spec.rb +0 -39
  61. data/spec/scalingo/regional/metrics_spec.rb +0 -46
  62. data/spec/scalingo/regional/notifiers_spec.rb +0 -113
  63. data/spec/scalingo/regional/operations_spec.rb +0 -27
  64. data/spec/scalingo/regional/scm_repo_links_spec.rb +0 -48
  65. data/spec/scalingo/regional_database/backups_spec.rb +0 -58
  66. data/spec/scalingo/regional_database/databases_spec.rb +0 -23
  67. data/spec/scalingo/regional_database_spec.rb +0 -11
  68. data/spec/scalingo/regional_spec.rb +0 -14
  69. data/spec/scalingo/token_holder_spec.rb +0 -81
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Scalingo::RegionalDatabase do
4
- subject { described_class.new("url") }
5
-
6
- %w[databases backups].each do |section|
7
- it "handles requests for #{section}" do
8
- expect(subject.respond_to?(section)).to be true
9
- end
10
- end
11
- end
@@ -1,14 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Scalingo::Regional do
4
- subject { described_class.new("url") }
5
-
6
- %w[
7
- addons apps autoscalers collaborators containers deployments domains
8
- environment events logs metrics notifiers operations scm_repo_links
9
- ].each do |section|
10
- it "handles requests for #{section}" do
11
- expect(subject.respond_to?(section)).to be true
12
- end
13
- end
14
- end
@@ -1,81 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Scalingo::TokenHolder do
4
- subject(:token_holder_dummy_class) do
5
- Class.new {
6
- include(Scalingo::TokenHolder)
7
- attr_accessor :config
8
- }
9
- end
10
-
11
- describe "authenticate_with_bearer_token" do
12
- subject { token_holder.authenticate_with_bearer_token(token, expires_at: expires_at, raise_on_expired_token: false) }
13
-
14
- let(:token_holder) do
15
- holder = token_holder_dummy_class.new
16
- holder.config = Scalingo::Configuration.new
17
-
18
- holder
19
- end
20
-
21
- context "without expiration date" do
22
- let(:token) { "1234" }
23
- let(:expires_at) { nil }
24
-
25
- it "set the auth token" do
26
- expect(token_holder.authenticated?).to be false
27
- subject
28
- expect(token_holder.authenticated?).to be true
29
- end
30
- end
31
-
32
- context "with an expiration date" do
33
- let(:token) { "1234" }
34
- let(:expires_at) { Time.now + 1.hour }
35
-
36
- it "refresh the auth token" do
37
- token_holder.authenticate_with_bearer_token(token, expires_at: 1.hour.ago, raise_on_expired_token: false)
38
- expect(token_holder.authenticated?).to be false
39
-
40
- subject
41
- expect(token_holder.authenticated?).to be true
42
- end
43
- end
44
- end
45
-
46
- describe "authenticate_database_with_bearer_token" do
47
- subject { token_holder.authenticate_database_with_bearer_token(database_id, token, expires_at: expires_at, raise_on_expired_token: false) }
48
-
49
- let(:token_holder) do
50
- holder = token_holder_dummy_class.new
51
- holder.config = Scalingo::Configuration.new
52
-
53
- holder
54
- end
55
-
56
- let(:database_id) { "db-id-1234" }
57
-
58
- context "without expiration date" do
59
- let(:token) { "1234" }
60
- let(:expires_at) { nil }
61
-
62
- it "set the database auth token" do
63
- expect(token_holder.authenticated_for_database?(database_id)).to be false
64
- subject
65
- expect(token_holder.authenticated_for_database?(database_id)).to be true
66
- end
67
- end
68
-
69
- context "with an expiration date" do
70
- let(:token) { "1234" }
71
- let(:expires_at) { Time.now + 1.hour }
72
-
73
- it "refresh the database token" do
74
- token_holder.authenticate_database_with_bearer_token(database_id, token, expires_at: 1.hour.ago, raise_on_expired_token: false)
75
- expect(token_holder.authenticated_for_database?(database_id)).to be false
76
- subject
77
- expect(token_holder.authenticated_for_database?(database_id)).to be true
78
- end
79
- end
80
- end
81
- end