smart_proxy_ipam 0.1.2 → 0.1.3

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: 9b450f64adc45001ed1f2b969a0291bbb1237fd4077411aca7fe28c54a373cc9
4
- data.tar.gz: f38780552bb70c0669a2e34758cda24a97f14ad31d147d13d0420f3eda01247b
3
+ metadata.gz: 99081e6b65f047761521c0baaff029fc1ce40e8a1e1b399be9ee88deb106479d
4
+ data.tar.gz: 9446d90c2358ad5e6759a2e3a25c720c00e926177f55278dd9f624ce098df7ab
5
5
  SHA512:
6
- metadata.gz: 932a9e52aa6c6a507a472e52a9fa3bd6e97af23bda10302ac5913ab93557bc69661c49500ad33d3fff5d375b2037cd2cf5e04fa58d0f559ad6473f5940da726c
7
- data.tar.gz: 292349dbefc9d9abcb4d9b3920e0475d5ed90caf7d460123b389d2dbd7a76a1417721fca1c5a3d03855fd774c78813fcc914bbef0d7e6c9ffa1a095a704b0d45
6
+ metadata.gz: 90416855e0de74c52d21787390029503640ebbe0b60854d6bc74265f8a3643bd2bd78c952fcfaa6548672715b4c635162ae6e799c210ec2d4589365d5f19921a
7
+ data.tar.gz: 4ab2f315c3722487d673ce0398d49a1cf2a9dace859e9eba900dc830c2042cd09d93ff0a49feed9fb6c0833a3c45933062a2c509ceb20ccb03659f62f1b123de
@@ -21,7 +21,7 @@ module Proxy::Ipam
21
21
  start_cleanup_task
22
22
  end
23
23
 
24
- def set_provider(provider)
24
+ def set_provider_name(provider)
25
25
  @provider = provider
26
26
  end
27
27
 
@@ -103,7 +103,7 @@ module Proxy::Ipam::IpamHelper
103
103
  end
104
104
 
105
105
  def get_request_group(params)
106
- group = params[:group] ? URI.escape(params[:group]) : nil
106
+ group = params[:group] ? URI.escape(URI.decode(params[:group])) : nil
107
107
  halt 500, { error: errors[:groups_not_supported] }.to_json if group && !provider.groups_supported?
108
108
  group
109
109
  end
@@ -21,7 +21,7 @@ module Proxy::Netbox
21
21
  @token = conf[:token]
22
22
  @api_resource = Proxy::Ipam::ApiResource.new(api_base: @api_base, token: "Token #{@token}")
23
23
  @ip_cache = Proxy::Ipam::IpCache.instance
24
- @ip_cache.set_provider('netbox')
24
+ @ip_cache.set_provider_name('netbox')
25
25
  end
26
26
 
27
27
  def get_ipam_subnet(cidr, group_name = nil)
@@ -70,7 +70,8 @@ module Proxy::Netbox
70
70
 
71
71
  def get_ipam_group(group_name)
72
72
  raise ERRORS[:groups_not_supported] unless groups_supported?
73
- params = URI.encode_www_form({ name: group_name })
73
+ # TODO: Fix encoding of params in a common way for all providers
74
+ params = URI.encode_www_form({ name: URI.decode(group_name) })
74
75
  response = @api_resource.get("ipam/vrfs/?#{params}")
75
76
  json_body = JSON.parse(response.body)
76
77
  return nil if json_body['count'].zero?
@@ -22,7 +22,7 @@ module Proxy::Phpipam
22
22
  @token = authenticate
23
23
  @api_resource = Proxy::Ipam::ApiResource.new(api_base: @api_base, token: @token, auth_header: 'Token')
24
24
  @ip_cache = Proxy::Ipam::IpCache.instance
25
- @ip_cache.set_provider('phpipam')
25
+ @ip_cache.set_provider_name('phpipam')
26
26
  end
27
27
 
28
28
  def get_ipam_subnet(cidr, group_name = nil)
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  module Ipam
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '0.1.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_ipam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Smith