conjur-api 4.10.2 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +27 -3
- data/conjur-api.gemspec +1 -1
- data/lib/conjur-api/version.rb +1 -1
- data/lib/conjur/configuration.rb +4 -2
- data/lib/conjur/variable.rb +1 -1
- data/spec/api/layer_spec.rb +3 -1
- data/spec/variable_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e054378922433060af0dadcc8c2abb3ceabb3054
|
4
|
+
data.tar.gz: 0b023d98362297b31c29cce5136c5de77aefde1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
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 = ["
|
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}
|
data/lib/conjur-api/version.rb
CHANGED
data/lib/conjur/configuration.rb
CHANGED
@@ -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)
|
data/lib/conjur/variable.rb
CHANGED
data/spec/api/layer_spec.rb
CHANGED
@@ -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")
|
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
|
data/spec/variable_spec.rb
CHANGED
@@ -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 = {'
|
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.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Rafal Rzepecki
|
8
8
|
- Kevin Gilpin
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
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.
|
321
|
+
rubygems_version: 2.0.14
|
322
322
|
signing_key:
|
323
323
|
specification_version: 4
|
324
324
|
summary: Conjur API
|