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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a01a1e754296f18b28317601696673a14cc92a659075bdbee7110f0ece741fde
|
|
4
|
+
data.tar.gz: f7a2cee7c0614ae57c40feceb763cdc90418a65cb3f46abba6a3e737069d7839
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74b6d9ccba0abfd033aafa58ebf24b2184e5fc30c56806e2daad4a6c8b77d83de216ae3c40a3a88d5a15403aa5f9058d589ae3a1ab93453f531cf2a9c2f7e452
|
|
7
|
+
data.tar.gz: 116df0b2b7104833188841b42ea21b541a288af99be1b3538c41fad7c1c6d45b049ff05704e9df0088a0fcb9ca678eee08e9692a40c043302046335364379f0b
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
require '
|
|
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
|
-
|
|
9
|
-
|
|
7
|
+
path = "#{Proxy::ContainerGateway::Plugin.settings.katello_registry_path}#{suffix}"
|
|
8
|
+
query = params.slice('scope', 'account').compact
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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)
|