smart_proxy_pulp 3.0.0 → 3.1.0

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: c62f3048872a9abdf3004d0d7af57b90ea8612e527f335231a0b25c6de22f86c
4
- data.tar.gz: 6bfa286ef21e1e00139593e88bfe50360de8866e867920bfefeb03eeeb39227d
3
+ metadata.gz: 530d39840a6bb5adb12546ec4c3e4fa50616e616ebadef98243076d9bd6d6692
4
+ data.tar.gz: ba3525a72ef1b4367519147166d71b03cc076b2ac7f101a7b0d31886f2a8529e
5
5
  SHA512:
6
- metadata.gz: 9f0185c2c5daadd9b4bc360c5c83bb5170de105a2d0767eda9653ce574ba7a7c6abc3bc303e63cc22ec76bacae1509207fc0d93d32e940a2bec184f2677e24c8
7
- data.tar.gz: 8caebd183fbd1f7cdf8eb715a60d3d48813869414fa02ebecf220cc49d5f9746fd389c647a5cb99d35f4fd8d7a58076ec75f2f0f504d1da104a22f19e5983213
6
+ metadata.gz: fb0ae49fe75c6a216182e430d9eff93bb509482fd84b48b36a39591ad2a2440824f964b09f4976ce34c14607fe782c9d9ecd805f19e17630d6d3ac248eac7361
7
+ data.tar.gz: 1bc3741848e30b49bf2cfed07bdd81c68b37a59db888e2ace7a203a20ddbf890a79b055c5982fd088bb121fd4d33325c1771341c6cd91eab9976d0135b58d7c6
@@ -1,18 +1,27 @@
1
+ require 'smart_proxy_pulp_plugin/validators'
2
+
1
3
  module PulpProxy
2
4
  class PulpcorePlugin < ::Proxy::Plugin
3
5
  plugin "pulpcore", ::PulpProxy::VERSION
4
6
  default_settings :pulp_url => 'https://localhost',
5
7
  :content_app_url => 'https://localhost:24816/',
6
- :mirror => false
8
+ :mirror => false,
9
+ :client_authentication => ['password', 'client_certificate']
10
+
11
+ AUTH_TYPES = ['password', 'client_certificate', 'client_certificate_admin_only'].freeze
7
12
 
13
+ load_validators include: ::PulpProxy::Validators::Include
8
14
  validate :pulp_url, :url => true
9
15
  validate :content_app_url, :url => true
16
+ validate :client_authentication, :include => AUTH_TYPES
10
17
 
11
18
  expose_setting :pulp_url
12
19
  expose_setting :mirror
13
20
  expose_setting :content_app_url
14
21
  expose_setting :username
15
22
  expose_setting :password
23
+ expose_setting :client_authentication
24
+
16
25
  capability -> { PulpcoreClient.capabilities }
17
26
  rackup_path File.expand_path('pulpcore_http_config.ru', __dir__)
18
27
  end
@@ -0,0 +1,15 @@
1
+ module PulpProxy
2
+ module Validators
3
+ class Include < ::Proxy::PluginValidators::Base
4
+ def validate!(settings)
5
+ setting_value = settings[@setting_name]
6
+
7
+ unless (setting_value - @params).empty?
8
+ raise ::Proxy::Error::ConfigurationError, "Parameter '#{@setting_name}' is expected to be one or more of #{@params}"
9
+ else
10
+ true
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module PulpProxy
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
@@ -5,3 +5,4 @@
5
5
  #:username: admin
6
6
  #:password: password
7
7
  #:mirror: false
8
+ #:client_authentication: ['password', 'client_certificate']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_pulp
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitri Dolguikh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -95,6 +95,7 @@ files:
95
95
  - lib/smart_proxy_pulp_plugin/pulpcore_client.rb
96
96
  - lib/smart_proxy_pulp_plugin/pulpcore_http_config.ru
97
97
  - lib/smart_proxy_pulp_plugin/pulpcore_plugin.rb
98
+ - lib/smart_proxy_pulp_plugin/validators.rb
98
99
  - lib/smart_proxy_pulp_plugin/version.rb
99
100
  - settings.d/pulpcore.yml.example
100
101
  homepage: https://github.com/theforeman/smart-proxy-pulp-plugin
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  - !ruby/object:Gem::Version
117
118
  version: '0'
118
119
  requirements: []
119
- rubygems_version: 3.1.4
120
+ rubygems_version: 3.1.6
120
121
  signing_key:
121
122
  specification_version: 4
122
123
  summary: Basic Pulp support for Foreman Smart-Proxy