smart_proxy_container_gateway 4.0.0 → 4.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fcdcfa36eed1f6e070503c159281e5c72e07cfd2b78c7fd08fc67e852b2eadb
4
- data.tar.gz: 834e6422b299d6e434c0cddd2923c3fa2d548109655221d8f259ff45e3becb0f
3
+ metadata.gz: a01a1e754296f18b28317601696673a14cc92a659075bdbee7110f0ece741fde
4
+ data.tar.gz: f7a2cee7c0614ae57c40feceb763cdc90418a65cb3f46abba6a3e737069d7839
5
5
  SHA512:
6
- metadata.gz: 7ef2a0fe40e712fa60e3222a707cac996b279efab0410763191cf69e24679f6cfff5ea2c07263bcb5d7bdefc196706e502d67e52c5411411bf7172a446736634
7
- data.tar.gz: 622dacf9d030aec24a60d3581bcb2dbf769bc9beb6d42a2544d0068dd70c10cddc176afe1241df22a8a34cfa29bc6db98b6a8bee650969678af2364c56786e77
6
+ metadata.gz: 74b6d9ccba0abfd033aafa58ebf24b2184e5fc30c56806e2daad4a6c8b77d83de216ae3c40a3a88d5a15403aa5f9058d589ae3a1ab93453f531cf2a9c2f7e452
7
+ data.tar.gz: 116df0b2b7104833188841b42ea21b541a288af99be1b3538c41fad7c1c6d45b049ff05704e9df0088a0fcb9ca678eee08e9692a40c043302046335364379f0b
@@ -1,27 +1,18 @@
1
- require 'uri'
2
- require 'openssl'
1
+ require 'proxy/request'
3
2
 
4
3
  module Proxy
5
4
  module ContainerGateway
6
- class ForemanApi
5
+ class ForemanApi < ::Proxy::HttpRequest::ForemanRequest
7
6
  def registry_request(auth_header, params, suffix, uuid: '', cert: false)
8
- uri = URI.join(Proxy::SETTINGS.foreman_url, Proxy::ContainerGateway::Plugin.settings.katello_registry_path, suffix)
9
- uri.query = process_params(params)
7
+ path = "#{Proxy::ContainerGateway::Plugin.settings.katello_registry_path}#{suffix}"
8
+ query = params.slice('scope', 'account').compact
10
9
 
11
- req = Net::HTTP::Get.new(uri)
12
- req.add_field('Authorization', auth_header) unless cert
13
- req.add_field('Accept', 'application/json')
14
- req.add_field('HostUUID', uuid) if cert
15
- req.content_type = 'application/json'
16
- http = Net::HTTP.new(uri.hostname, uri.port)
17
- http.use_ssl = true
10
+ headers = {}
11
+ headers['Authorization'] = auth_header unless cert
12
+ headers['HostUUID'] = uuid if cert
18
13
 
19
- http.request(req)
20
- end
21
-
22
- def process_params(params_in)
23
- params = params_in.slice('scope', 'account').compact
24
- URI.encode_www_form(params)
14
+ req = request_factory.create_get(path, query, headers)
15
+ send_request(req)
25
16
  end
26
17
 
27
18
  def fetch_token(auth_header, params)
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module ContainerGateway
3
- VERSION = '4.0.0'.freeze
3
+ VERSION = '4.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_container_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ballou