influxdb 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 6c2b06fa209203def8adb7dd52f58f7abec274f7
4
- data.tar.gz: 16aa0e2a02215f6738cebcdfd8b4b988778f5187
3
+ metadata.gz: 9175c1e5dc3934144b01c90acf625770219d052b
4
+ data.tar.gz: e06c8e8f3fa04429e58c97d4f4b2f30c0dcbc4da
5
5
  SHA512:
6
- metadata.gz: 075868eb0f2dd7b08cc1baad82a7fd4aa27516a627b035d64e9779270bc23f25625780b93c8a210c4b5c4e5c12cea1848b5a3c9c54e5889b5a674b1b57d5246e
7
- data.tar.gz: 25ec27ea28255e5449e18beca91036ecfc4a859ab887a1aca0199ba68376ad6481165c710c8d6465a3e6d34acc0b8b553cb036a086259c8001fa78cebe393f43
6
+ metadata.gz: 0cd3923bcbf70d4aef40062fbec6b8e924403a3b83631861bb0dc71e7eaefdd53ffaa7d38935a289045d20e337b0531a48173e558079da5cadbcc9a52ea088be
7
+ data.tar.gz: 9f2cca0b974e8fdb3342356645dbb75963cf03c23c672ed439566160ebbca8fbb76810fa46ceddfc943e0e0b65df62120afa9f12cbb2da9dcb898bba8819bfd1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  For the full commit log, [see here](https://github.com/influxdata/influxdb-ruby/commits/master).
4
4
 
5
+ ## v0.3.2, released 2016-06-02
6
+
7
+ - Added config option to authenticate without credentials (#146, @pmenglund).
8
+
5
9
  ## v0.3.1, released 2016-05-26
6
10
 
7
11
  - Fixed #130 (again). Integer values are now really written as Integers to InfluxDB.
@@ -3,7 +3,7 @@ require 'thread'
3
3
  module InfluxDB
4
4
  # InfluxDB client configuration
5
5
  class Config
6
- AUTH_METHODS = ["params".freeze, "basic_auth".freeze].freeze
6
+ AUTH_METHODS = ["params".freeze, "basic_auth".freeze, "none".freeze].freeze
7
7
 
8
8
  attr_accessor :port,
9
9
  :username,
@@ -111,7 +111,7 @@ module InfluxDB
111
111
  end
112
112
 
113
113
  def full_url(path, params = {})
114
- unless basic_auth?
114
+ if config.auth_method == "params".freeze
115
115
  params[:u] = config.username
116
116
  params[:p] = config.password
117
117
  end
@@ -1,3 +1,3 @@
1
1
  module InfluxDB # :nodoc:
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -22,14 +22,30 @@ describe InfluxDB::Client do
22
22
  let(:pass) { 'passpass' }
23
23
  let(:query) { "CREATE USER #{user} WITH PASSWORD '#{pass}' WITH ALL PRIVILEGES" }
24
24
 
25
- before do
26
- stub_request(:get, "http://influxdb.test:9999/query").with(
27
- query: { u: "username", p: "password", q: query }
28
- )
25
+ context 'with existing admin user' do
26
+ before do
27
+ stub_request(:get, "http://influxdb.test:9999/query").with(
28
+ query: { u: "username", p: "password", q: query }
29
+ )
30
+ end
31
+
32
+ it "should GET to create a new cluster admin" do
33
+ expect(subject.create_cluster_admin(user, pass)).to be_a(Net::HTTPOK)
34
+ end
29
35
  end
30
36
 
31
- it "should GET to create a new cluster admin" do
32
- expect(subject.create_cluster_admin(user, pass)).to be_a(Net::HTTPOK)
37
+ context 'with no admin user' do
38
+ let(:args) { { auth_method: 'none' } }
39
+
40
+ before do
41
+ stub_request(:get, "http://influxdb.test:9999/query").with(
42
+ query: { q: query }
43
+ )
44
+ end
45
+
46
+ it "should GET to create a new cluster admin" do
47
+ expect(subject.create_cluster_admin(user, pass)).to be_a(Net::HTTPOK)
48
+ end
33
49
  end
34
50
  end
35
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Persen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json