conjur-api 4.10.2 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 430af90880bc80ca4db9982fc99c0d670f17aa6f
4
- data.tar.gz: 67be43db258ef8acfbae41801534aa615675da0a
3
+ metadata.gz: e054378922433060af0dadcc8c2abb3ceabb3054
4
+ data.tar.gz: 0b023d98362297b31c29cce5136c5de77aefde1d
5
5
  SHA512:
6
- metadata.gz: 727e9688efb27f47f99c2e06ee02ef96cbfae03bda9ce177bd31200a8d52577c410166ba08de06b4cb11546c6c109fe52bd7a68804d14e34026e3700b7860e88
7
- data.tar.gz: c94276c5d61ac5571f2da98b7d472cf56db274d396cffda3da34dff190f1fcd1b7804e693d472737472066263eab36ed58d7f4723b2519bc6fc7fab4dee900a0
6
+ metadata.gz: a8d2c6a4ef70523dfb251ffc539d023aff3220469524baa029c1d277bc3619b1350e0480d9583b14356541f62c8ec9dae8f2ce4b681d616ef7021d33056a81ce
7
+ data.tar.gz: e96fd20bf4a8c08e9eb184baa5d11413aed385d27dbee962bfda971d341082b7c9420c6503eb31ab9722dbafdd76c4c2bbe92db2aed1d20fcc60f6dde5fde95b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # v4.11.0
2
+
3
+ * Fixed bug retrieving `Variable#version_count`
4
+ * Include CONJUR_ENV in `Conjur.configuration`
5
+ * Add `cert_file` option to `Conjur.configuration`
6
+
7
+
1
8
  # v.4.10.2
2
9
  * Authn token is refetched before the expiration
3
10
  * Support for configuration `sticky` option is discarded
data/README.md CHANGED
@@ -18,17 +18,41 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- To instantiate the API, using configuration stored stored in `~/.conjurrc`:
21
+ ### Programmatic configuration
22
+
23
+ To configure the API to connect to Conjur, specify the account and appliance_url (both of which are required) like this:
24
+
25
+ ```ruby
26
+ Conjur.configuration.account = 'my-account'
27
+ Conjur.configuration.appliance_url = 'https://conjur.mydomain.com/api'
28
+ ```
29
+
30
+ You can also specify these values in environment variables, which is often a bit more convenient. Environment variables are mapped to configuration variables by prepending CONJUR_ to the all-caps name of the configuration variable, for example, `appliance_url` is `CONJUR_APPLIANCE_URL`, `account` is `CONJUR_ACCOUNT`, etc.
31
+
32
+ In either case, if you are using Conjur's self-signed cert, you will also need to configure certificate trust:
33
+
34
+ ```ruby
35
+ OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE.add_file "/path/to/conjur-youraccount.pem"
36
+ ```
37
+
38
+ ### Using Conjur system configuraiton
39
+
40
+ To instantiate the API using configuration stored stored in `/etc/conjur.conf` and/or `~/.conjurrc`:
22
41
 
23
42
  ```ruby
24
43
  require 'conjur/cli'
25
44
  Conjur::Config.load
45
+ Conjur::Config.apply
26
46
  conjur = Conjur::API.new_from_key username, api_key
27
47
  ```
28
48
 
29
- You can find the username and api_key in ~/.netrc after you've logged in.
49
+ `username` and `api_key` can also be provided by environment variables: `CONJUR_AUTHN_LOGIN` and `CONJUR_AUTHN_API_KEY`. If the login is a host, the `CONJUR_AUTHN_LOGIN` should be prefixed with `host/`. For example: `host/myhost.example.com`.
30
50
 
31
- Fancier/different init scenarios are possible but this should be a good start!
51
+ If the login and API key are provided by `netrc` or by the environment, you can construct an API client using:
52
+
53
+ ```ruby
54
+ conjur = Conjur::Authn.connect
55
+ ```
32
56
 
33
57
  ## Contributing
34
58
 
data/conjur-api.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  require File.expand_path('../lib/conjur-api/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ["Rafa\305\202 Rzepecki","Kevin Gilpin"]
5
+ gem.authors = ["Rafal Rzepecki","Kevin Gilpin"]
6
6
  gem.email = ["rafal@conjur.net","kgilpin@conjur.net"]
7
7
  gem.description = %q{Conjur API}
8
8
  gem.summary = %q{Conjur API}
@@ -20,6 +20,6 @@
20
20
  #
21
21
  module Conjur
22
22
  class API
23
- VERSION = "4.10.2"
23
+ VERSION = "4.11.0"
24
24
  end
25
25
  end
@@ -147,7 +147,7 @@ module Conjur
147
147
  add_option :account, required: true
148
148
 
149
149
  add_option :env do
150
- ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "production"
150
+ ENV['CONJUR_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "production"
151
151
  end
152
152
 
153
153
  add_option :stack do
@@ -158,7 +158,9 @@ module Conjur
158
158
  env
159
159
  end
160
160
  end
161
-
161
+
162
+ add_option :cert_file
163
+
162
164
  private
163
165
 
164
166
  def global_service_url(service_name, service_port_offset)
@@ -35,7 +35,7 @@ module Conjur
35
35
  end
36
36
 
37
37
  def version_count
38
- self.attributes['versions']
38
+ self.attributes['version_count']
39
39
  end
40
40
 
41
41
  def value(version = nil)
@@ -8,7 +8,9 @@ describe Conjur::Layer do
8
8
  it "casts Host to roleid" do
9
9
  host = double(:host)
10
10
  expect(host).to receive(:roleid).and_return "the-hostid"
11
- stub_request(:post, "http://example.com/layers/my%2Flayername/hosts").with(hostid: "the-hostid")
11
+ stub_request(:post, "http://example.com/layers/my%2Flayername/hosts")
12
+ .with(body: {hostid: 'the-hostid' })
13
+
12
14
 
13
15
  subject.add_host host
14
16
  end
@@ -4,7 +4,7 @@ describe Conjur::Variable do
4
4
  let(:url) { "http://example.com/variable" }
5
5
  subject(:variable) { Conjur::Variable.new url }
6
6
 
7
- before { subject.attributes = {'versions' => 42} }
7
+ before { subject.attributes = {'version_count' => 42} }
8
8
 
9
9
  describe '#version_count' do
10
10
  it "is read from the attributes" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.2
4
+ version: 4.11.0
5
5
  platform: ruby
6
6
  authors:
7
- - Rafał Rzepecki
7
+ - Rafal Rzepecki
8
8
  - Kevin Gilpin
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-22 00:00:00.000000000 Z
12
+ date: 2014-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -318,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
318
  version: '0'
319
319
  requirements: []
320
320
  rubyforge_project:
321
- rubygems_version: 2.2.1
321
+ rubygems_version: 2.0.14
322
322
  signing_key:
323
323
  specification_version: 4
324
324
  summary: Conjur API