smart_proxy_container_gateway 1.0.5 → 1.0.6

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: f7f64eda929055e1dbf8e33f6f25797f5f01eaec99fc44c68b48cdbb54e3ac24
4
- data.tar.gz: 3b82489df2523cc112474f8f88925959123db0ea34848462dcaa3a15aa2f01f0
3
+ metadata.gz: 6b202377506c454b212838c974ef30778b9342fc77c3caa694770b8255d9e643
4
+ data.tar.gz: 3207291839143bc9680c9562c68622e8e5c2bd8db35ff1dad1efc14bc72567fc
5
5
  SHA512:
6
- metadata.gz: 7275b37d4d4e2de7be47377f45790277df201752f429a3d1bea719a7f644b9a59e7b39a312f75d4b6c75d66c2ada8a21970cab2b6ee665ee11c45dfd739d2905
7
- data.tar.gz: 0f12062658a3840ddccb627e1e2ef2602e3e53b03b218684ff2f6a733504107a49329237d56f6a0b5ed6669509b422622459f84dc2c66484ddb99f5ec10bfa71
6
+ metadata.gz: b1ae526f1337adbb209ccb8ba0beb17d6fa31507d54c82edf8f5f3bdd36025850b1eb1bf81cdab8a28bc9cd38e1a4e10e3e62445bbeec0c4f3e7f1f40917473c
7
+ data.tar.gz: 82e6da4388878b1acbf44b4f0a400ab0860310177805ac3173d67d879c60dc11b76592f69ff55455c2ac3404f1d002c042a88cf6b1d3afd0423b7b3aa6a786a9
@@ -25,15 +25,19 @@ module Proxy
25
25
  end
26
26
  end
27
27
 
28
- get '/v2/:repository/manifests/:tag/?' do
29
- handle_repo_auth(params, auth_header, request)
30
- redirection_location = Proxy::ContainerGateway.manifests(params[:repository], params[:tag])
28
+ get '/v2/*/manifests/*/?' do
29
+ repository = params[:splat][0]
30
+ tag = params[:splat][1]
31
+ handle_repo_auth(repository, auth_header, request)
32
+ redirection_location = Proxy::ContainerGateway.manifests(repository, tag)
31
33
  redirect to(redirection_location)
32
34
  end
33
35
 
34
- get '/v2/:repository/blobs/:digest/?' do
35
- handle_repo_auth(params, auth_header, request)
36
- redirection_location = Proxy::ContainerGateway.blobs(params[:repository], params[:digest])
36
+ get '/v2/*/blobs/*/?' do
37
+ repository = params[:splat][0]
38
+ digest = params[:splat][1]
39
+ handle_repo_auth(repository, auth_header, request)
40
+ redirection_location = Proxy::ContainerGateway.blobs(repository, digest)
37
41
  redirect to(redirection_location)
38
42
  end
39
43
 
@@ -130,7 +134,7 @@ module Proxy
130
134
 
131
135
  private
132
136
 
133
- def handle_repo_auth(params, auth_header, request)
137
+ def handle_repo_auth(repository, auth_header, request)
134
138
  user_token_is_valid = false
135
139
  # FIXME: Getting unauthenticated token here...
136
140
  if auth_header.present? && auth_header.valid_user_token?
@@ -139,7 +143,7 @@ module Proxy
139
143
  end
140
144
  username = request.params['account'] if username.nil?
141
145
 
142
- return if Proxy::ContainerGateway.authorized_for_repo?(params[:repository], user_token_is_valid, username)
146
+ return if Proxy::ContainerGateway.authorized_for_repo?(repository, user_token_is_valid, username)
143
147
 
144
148
  redirect_authorization_headers
145
149
  halt 401, "unauthorized"
@@ -92,6 +92,8 @@ module Proxy
92
92
  RepositoryUser.dataset.delete
93
93
  user_repo_maps['users'].each do |user_repo_map|
94
94
  user_repo_map.each do |user, repos|
95
+ next if repos.nil?
96
+
95
97
  repos.each do |repo|
96
98
  found_repo = Repository.find(name: repo['repository'],
97
99
  auth_required: repo['auth_required'].to_s.downcase == "true")
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module ContainerGateway
3
- VERSION = '1.0.5'.freeze
3
+ VERSION = '1.0.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_container_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ballou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel