smart_proxy_container_gateway 4.0.2 → 4.0.4
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: 4071f3495101c182650fbb5a894701d1d60d6a552eb43e4f1f7e07c558e75d7e
|
|
4
|
+
data.tar.gz: d7b251ba17c8e9360bc7fe88bbca8764be924f16ec41b061be0dc525604cebae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6c2eede99c97f359b6a9803b94eeab8d74325b84e2fb381c71e7a1626a7248c7f098737a8bbf2fb4418f0f0b246bae7e6084d69d7b05404ae133f5b9b30cf64
|
|
7
|
+
data.tar.gz: 88d1890fcd6a3c2ca7724151175cc29badc8ae21b7a1e94a7f7098c20d18a777c133c874d25598c47fb7d2cf1435d50b1d0e6fd3ae9603c43ae10da0d715bd0b
|
data/README.md
CHANGED
|
@@ -30,7 +30,7 @@ The Container Gateway plugin requires a Pulp 3 instance to connect to. Related
|
|
|
30
30
|
```
|
|
31
31
|
:pulp_endpoint: 'https://your_pulp_3_server_here.com'
|
|
32
32
|
:pulp_client_ssl_cert: 'Path to X509 certificate for authenticating with Pulp'
|
|
33
|
-
:pulp_client_ssl_key: 'Path to
|
|
33
|
+
:pulp_client_ssl_key: 'Path to private key for the Pulp certificate'
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
# Database information
|
|
@@ -78,10 +78,19 @@ module Proxy
|
|
|
78
78
|
if pulp_response.code.to_i >= 400
|
|
79
79
|
status pulp_response.code.to_i
|
|
80
80
|
body pulp_response.body
|
|
81
|
-
|
|
81
|
+
elsif [301, 302, 307].include?(pulp_response.code.to_i)
|
|
82
82
|
redirection_uri = URI(pulp_response['location'])
|
|
83
83
|
redirection_uri.host = URI(container_gateway_main.client_endpoint).host
|
|
84
84
|
redirect(redirection_uri.to_s)
|
|
85
|
+
else
|
|
86
|
+
status pulp_response.code.to_i
|
|
87
|
+
digest = pulp_response['docker-content-digest']
|
|
88
|
+
content_type = pulp_response['content-type']
|
|
89
|
+
content_length = pulp_response['content-length']
|
|
90
|
+
response.headers['Docker-Content-Digest'] = digest if digest
|
|
91
|
+
response.headers['Content-Type'] = content_type if content_type
|
|
92
|
+
response.headers['Content-Length'] = content_length if content_length
|
|
93
|
+
body pulp_response.body
|
|
85
94
|
end
|
|
86
95
|
end
|
|
87
96
|
|
|
@@ -181,11 +190,11 @@ module Proxy
|
|
|
181
190
|
get '/v2/token' do
|
|
182
191
|
response.headers['Docker-Distribution-API-Version'] = 'registry/2.0'
|
|
183
192
|
|
|
184
|
-
# Flatpak
|
|
185
|
-
#
|
|
186
|
-
#
|
|
187
|
-
#
|
|
188
|
-
if
|
|
193
|
+
# Some clients (e.g. Flatpak, Cincinnati) do not include the account
|
|
194
|
+
# query parameter in the token request. Extract the username from the
|
|
195
|
+
# Base64-encoded Basic Authorization header and use it as the account
|
|
196
|
+
# param when inserting a new token record.
|
|
197
|
+
if request.params['account'].nil? && auth_header.raw_header.present?
|
|
189
198
|
encoded_string = auth_header.raw_header&.split(' ')&.[](1)
|
|
190
199
|
decoded_string = Base64.decode64(encoded_string) if encoded_string.present?
|
|
191
200
|
username = decoded_string.split(':')[0] if decoded_string.present?
|
|
@@ -19,9 +19,7 @@ module Proxy
|
|
|
19
19
|
@client_endpoint = client_endpoint || pulp_endpoint
|
|
20
20
|
@pulp_client_ssl_ca = pulp_client_ssl_ca
|
|
21
21
|
@pulp_client_ssl_cert = OpenSSL::X509::Certificate.new(File.read(pulp_client_ssl_cert))
|
|
22
|
-
@pulp_client_ssl_key = OpenSSL::PKey
|
|
23
|
-
File.read(pulp_client_ssl_key)
|
|
24
|
-
)
|
|
22
|
+
@pulp_client_ssl_key = OpenSSL::PKey.read(File.read(pulp_client_ssl_key))
|
|
25
23
|
end
|
|
26
24
|
# rubocop:enable Metrics/ParameterLists, Layout/LineLength
|
|
27
25
|
|