zabbix-api-simple 0.2.1 → 0.2.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: 46064cab99de1a18915c05f63d2101160a28ef67a4d6c32b612e1467894b1fa6
4
- data.tar.gz: 8dff176c2e45d4a440344af791faa95b9d4f99b77bc8da215fb9341a3db6b6cc
3
+ metadata.gz: fc07e3c44b9f77ae8ca40da089d206bdcdb176e03fac49184cafbe41f2bc613a
4
+ data.tar.gz: b05b2fa3bd4d1622c5dd5d079c022555bacd6264ca20a51cb843a628856a4a25
5
5
  SHA512:
6
- metadata.gz: 8fc06be35eac88c1566c6b6d4a3735f69feec302506173a1c491d3e11fc43d51fe9c291bd5be34eed8e2d5bea215f99e01b96da187d402e2fa627fe01300609b
7
- data.tar.gz: 39fe035780ffa88b348a8d77ee50fa94a94607d0f82ea4e240874de7be3e6787023ee0f3e9d3617ac201cd625cc19be6387a013cedfa2613c05ff5d23ab25960
6
+ metadata.gz: d7e0fb56182ff8ff578c2ee37689a013ef56a105b1ddfe8729321f43e29a55be9f57eb7b586f79d0f508826d78a7c0256fd20a61b0cb907a4b65488c1f5514c8
7
+ data.tar.gz: 226e82097a386288806dbe3a7f7b03dc53bc22f26cfa435f72b9f833381f2017f41d124be21a77a6f35a6dc0baab0bc294230355dbb821f90ad032dbbaedc8c2
@@ -1,5 +1,6 @@
1
1
  module Zabbix
2
2
  module Api
3
+ UsernameChangeVersion = "6.4.0"
3
4
 
4
5
  require 'faraday'
5
6
  require 'faraday/net_http'
@@ -139,7 +140,12 @@ module Zabbix
139
140
  # both :user and :pass are required. This method calls user.logic
140
141
  # abd stores the returned auth token for future calls to the api
141
142
  def login(user: nil,pass: nil)
142
- res =post(method: 'user.login', params: {user: user, password:pass}, auth:nil)
143
+ version = call('apiinfo.version',{}).result
144
+ if version < UsernameChangeVersion
145
+ res =post(method: 'user.login', params: {user: user, password:pass}, auth:nil)
146
+ else
147
+ res =post(method: 'user.login', params: {username: user, password:pass}, auth:nil)
148
+ end
143
149
  @token = res.body['result']
144
150
  OpenStruct.new(res.body)
145
151
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Zabbix
4
4
  module Api
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.3"
6
6
  end
7
7
  end
data/zabbix-api.gemspec CHANGED
@@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  # For more information and examples about making a new gem, checkout our
35
35
  # guide at: https://bundler.io/guides/creating_gem.html
36
- spec.add_dependency 'faraday', "~> 2.0"
37
- spec.add_dependency 'faraday-net_http', "~> 2.0"
36
+ spec.add_dependency 'faraday', ">= 2.0"
37
+ spec.add_dependency 'faraday-net_http', ">= 2.0"
38
38
  spec.add_dependency 'optimist'
39
39
  spec.add_dependency 'amazing_print'
40
40
  spec.add_dependency 'pry'
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix-api-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Parker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-06 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday-net_http
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubygems_version: 3.1.6
161
+ rubygems_version: 3.4.10
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Zabbix API wrapper