fog-openstack 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da9787ae70b0a9dc7fd9ba6ec0f74ebba6e484b092d0eb4d67e42c50648e3a5c
4
- data.tar.gz: 388c37ffa743e4889c6079ae724899f91ba20285c649c5e8a24c01a356706bd2
3
+ metadata.gz: 6f1a987e1cdb15819df9574bd24325126715362ae879b23f06b7a5a705d73a09
4
+ data.tar.gz: 2960cb5a953347ccd02f2b34f20855fa47ab7cc267e22a4bd3568c80a08f5e7c
5
5
  SHA512:
6
- metadata.gz: 4db823a7a282570134fd638d35f8abc6e94e7b53d6b25b990022edd1ca49cba65750671155c571fb8d2a1df26b4b25b61cbfe05eb16842b9aaf4dac71843d8ce
7
- data.tar.gz: e7fbbe4a4b69a4b44082cb6bd89f323858d9ab59a97d8ed7bd58f17b7b235212b560702ee3127a17acb1361dbfdd787501c7c326305d0077caaa312f7d3c0e66
6
+ metadata.gz: 341a1f504b125f03f153762a246dd327b5efe933082592f969b688786eb179eb2f392bb57ba8dc69bc1e15ef36364499455a3cc917e7d8acaff3ad31f1ab7876
7
+ data.tar.gz: d121394ee777d1df119df6fabe654166ce5b6fa23390b3f20b7831fb1ff297420481df3c68ba0ae85c68af7b57fcb2f1dcee0c2c3fdbac88c7d621d3b0662f35
@@ -0,0 +1,2 @@
1
+ github: geemus
2
+ tidelift: rubygems/fog-openstack
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,16 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+ schedule:
9
+ - cron: '0 0 * * 1' # At 00:00 on Monday.
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ Shared:
16
+ uses: fog/.github/.github/workflows/ci.yml@v1.4.0
@@ -11,7 +11,7 @@ jobs:
11
11
  rubocop:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
15
  - uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: 3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 1.1.2 2024/06/12
2
+
3
+ * add support for application credentials to storage
4
+
5
+ # 1.1.1 2024/05/14
6
+
7
+ * delete newlines in base64 encoding
8
+ * misc repo maintenance
9
+ * add support for authentication via application credentials
10
+
11
+ ...
12
+
1
13
  # 1.10.1 2013/04/04
2
14
 
3
15
  ## Storage
data/SECURITY.md ADDED
@@ -0,0 +1,6 @@
1
+ ## Security contact information
2
+
3
+ To report a security vulnerability, please contact
4
+ [Tidelift security](https://tidelift.com/security).
5
+
6
+ Tidelift will coordinate the fix and disclosure.
File without changes
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'rubocop'
35
35
  spec.add_development_dependency 'shindo', '~> 0.3'
36
36
  spec.add_development_dependency 'vcr'
37
- spec.add_development_dependency 'webmock', '~> 1.24.6'
37
+ spec.add_development_dependency 'webmock', '~> 3.16.2'
38
38
  end
@@ -18,6 +18,11 @@ module Fog
18
18
  'methods' => ['token'],
19
19
  'token' => {'id' => @token}
20
20
  }
21
+ elsif @application_credential
22
+ {
23
+ 'methods' => ['application_credential'],
24
+ 'application_credential' => @application_credential
25
+ }
21
26
  else
22
27
  {
23
28
  'methods' => ['password'],
@@ -50,6 +55,7 @@ module Fog
50
55
  end
51
56
 
52
57
  def scope
58
+ return nil if @application_credential
53
59
  return @project.identity if @project
54
60
  return @domain.identity if @domain
55
61
  end
@@ -96,6 +102,11 @@ module Fog
96
102
 
97
103
  if auth[:openstack_auth_token]
98
104
  @token = auth[:openstack_auth_token]
105
+ elsif auth[:openstack_application_credential_id] and auth[:openstack_application_credential_secret]
106
+ @application_credential = {
107
+ :id => auth[:openstack_application_credential_id],
108
+ :secret => auth[:openstack_application_credential_secret],
109
+ }
99
110
  else
100
111
  @user = Fog::OpenStack::Auth::User.new(auth[:openstack_userid], auth[:openstack_username])
101
112
  @user.password = auth[:openstack_api_key]
@@ -87,7 +87,7 @@ module Fog
87
87
  end
88
88
 
89
89
  def user_data=(ascii_userdata)
90
- self.user_data_encoded = [ascii_userdata].pack('m') if ascii_userdata
90
+ self.user_data_encoded = [ascii_userdata].pack('m0') if ascii_userdata
91
91
  end
92
92
 
93
93
  def destroy
@@ -14,7 +14,8 @@ module Fog
14
14
  :openstack_project_name, :openstack_project_id,
15
15
  :openstack_project_domain, :openstack_user_domain, :openstack_domain_name,
16
16
  :openstack_project_domain_id, :openstack_user_domain_id, :openstack_domain_id,
17
- :openstack_identity_api_version
17
+ :openstack_identity_api_version, :openstack_application_credential_id,
18
+ :openstack_application_credential_secret
18
19
 
19
20
  ## MODELS
20
21
  #
@@ -16,6 +16,8 @@ module Fog
16
16
  attr_reader :openstack_project_id
17
17
  attr_reader :openstack_project_domain_id
18
18
  attr_reader :openstack_identity_api_version
19
+ attr_reader :openstack_application_credential_id
20
+ attr_reader :openstack_application_credential_secret
19
21
 
20
22
  # fallback
21
23
  def self.not_found_class
@@ -184,10 +186,11 @@ module Fog
184
186
  @openstack_can_reauthenticate = false
185
187
  else
186
188
  missing_credentials = []
187
-
188
- missing_credentials << :openstack_api_key unless @openstack_api_key
189
- unless @openstack_username || @openstack_userid
190
- missing_credentials << 'openstack_username or openstack_userid'
189
+ unless @openstack_application_credential_secret and @openstack_application_credential_id
190
+ missing_credentials << :openstack_api_key unless @openstack_api_key
191
+ unless @openstack_username || @openstack_userid
192
+ missing_credentials << 'openstack_username/openstack_userid or openstack_application_credential_secret and openstack_application_credential_id'
193
+ end
191
194
  end
192
195
  unless missing_credentials.empty?
193
196
  raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}"
@@ -13,7 +13,8 @@ module Fog
13
13
  :openstack_user_domain_id, :openstack_project_domain_id,
14
14
  :openstack_api_key, :openstack_current_user_id, :openstack_userid, :openstack_username,
15
15
  :current_user, :current_user_id, :current_tenant,
16
- :provider, :openstack_identity_api_version, :openstack_cache_ttl
16
+ :provider, :openstack_identity_api_version, :openstack_cache_ttl, :openstack_application_credential_id,
17
+ :openstack_application_credential_secret
17
18
 
18
19
  model_path 'fog/openstack/identity/v3/models'
19
20
  model :domain
@@ -13,7 +13,8 @@ module Fog
13
13
  :openstack_project_name, :openstack_project_id,
14
14
  :openstack_project_domain, :openstack_user_domain, :openstack_domain_name,
15
15
  :openstack_project_domain_id, :openstack_user_domain_id, :openstack_domain_id,
16
- :openstack_identity_api_version
16
+ :openstack_identity_api_version, :openstack_application_credential_id,
17
+ :openstack_application_credential_secret
17
18
 
18
19
  ## MODELS
19
20
  #
@@ -68,12 +68,12 @@ module Fog
68
68
  template = template_file
69
69
  elsif template_is_raw?(template_file)
70
70
  template_base_url = local_base_url
71
- template = YAML.safe_load(template_file, [Date])
71
+ template = YAML.safe_load(template_file, :permitted_classes => [Date])
72
72
  elsif template_is_url?(template_file)
73
73
  template_file = normalise_file_path_to_url(template_file)
74
74
  template_base_url = base_url_for_url(template_file)
75
75
  raw_template = read_uri(template_file)
76
- template = YAML.safe_load(raw_template, [Date])
76
+ template = YAML.safe_load(raw_template, :permitted_classes => [Date])
77
77
 
78
78
  Fog::Logger.debug("Template visited: #{@visited}")
79
79
  @visited.add(template_file)
@@ -212,7 +212,7 @@ module Fog
212
212
  def deep_copy(item)
213
213
  return item if item.kind_of?(String)
214
214
 
215
- YAML.safe_load(YAML.dump(item), [Date])
215
+ YAML.safe_load(YAML.dump(item), :permitted_classes => [Date])
216
216
  end
217
217
  end
218
218
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module OpenStack
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.1.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2024-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.24.6
187
+ version: 3.16.2
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 1.24.6
194
+ version: 3.16.2
195
195
  description: OpenStack fog provider gem.
196
196
  email:
197
197
  - matt.darby@rackspace.com
@@ -199,8 +199,10 @@ executables: []
199
199
  extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
+ - ".github/FUNDING.yml"
203
+ - ".github/dependabot.yml"
204
+ - ".github/workflows/ci.yml"
202
205
  - ".github/workflows/linting.yml"
203
- - ".github/workflows/main.yml"
204
206
  - ".gitignore"
205
207
  - ".hound.yml"
206
208
  - ".rubocop.yml"
@@ -214,6 +216,7 @@ files:
214
216
  - LICENSE.md
215
217
  - README.md
216
218
  - Rakefile
219
+ - SECURITY.md
217
220
  - bin/console
218
221
  - bin/setup
219
222
  - docker-compose.yml
@@ -1451,7 +1454,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1451
1454
  - !ruby/object:Gem::Version
1452
1455
  version: '0'
1453
1456
  requirements: []
1454
- rubygems_version: 3.0.3
1457
+ rubygems_version: 3.4.10
1455
1458
  signing_key:
1456
1459
  specification_version: 4
1457
1460
  summary: OpenStack fog provider gem
@@ -1,37 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: Ruby
9
-
10
- on:
11
- push:
12
- branches: [ master ]
13
- pull_request:
14
- branches: [ master ]
15
-
16
- jobs:
17
- test:
18
-
19
- runs-on: ubuntu-latest
20
- strategy:
21
- matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
23
-
24
- steps:
25
- - uses: actions/checkout@v2
26
- - name: Set up Ruby
27
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
- # uses: ruby/setup-ruby@v1
30
- uses: ruby/setup-ruby@v1
31
- with:
32
- ruby-version: ${{ matrix.ruby-version }}
33
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
- - name: Run unit tests
35
- run: bundle exec rake tests:unit
36
- - name: Run specs tests
37
- run: bundle exec rake tests:spec