aptible-auth 0.1.3 → 0.1.4

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: 944d38b34bbc1c213f954760d6ff5b7a580a4f0a
4
- data.tar.gz: a7fc6914293f4f159e8e0f3192736355812f1b95
3
+ metadata.gz: db3c1ba550b3a777611816a3828b182d0e2d3a27
4
+ data.tar.gz: 97fe3444852024e2c306c40a85ac900179a4bfb1
5
5
  SHA512:
6
- metadata.gz: 3ff9d46b6e646a2ed567eb90b90e64ad2f6a248d299c06d175bc64ae4cfa8942ea0718f914d63704712cc2aab563e50d65507e7cf54d115e63ebfd2393641957
7
- data.tar.gz: 785dbffe0912ee10277e64576a5945d1eca5218cd4964ad94c9dee5e95d1450c7a1149b40dcad6ebfeb417831e80fc73b208dca03bb2126030dac93844f5548c
6
+ metadata.gz: 2e106b93c20c79b736d18a7d7def5d381a1b6a956fce65c60acf06363f96d8ee336627e5d897bbe791be543900a1bc16e4a8d32c54cfcc1153c2a2a983d6b9c9
7
+ data.tar.gz: af94ac3a6532389de1a5daece03a11aee35441189dcc77ba63e9f9aca11a1a6c54f967a54d4314c5481118e2f42206a9dfd9fac7a01ca171259f7f4518e32e16
data/README.md CHANGED
@@ -49,9 +49,9 @@ client.href
49
49
 
50
50
  | Parameter | Description | Default |
51
51
  | --------- | ----------- | --------------- |
52
- | `root_url` | Root URL of the authorization server | `https://auth.aptible.com` |
52
+ | `root_url` | Root URL of the authorization server | `ENV['APTIBLE_AUTH_ROOT_URL']` or [https://auth.aptible.com](https://auth.aptible.com) |
53
53
 
54
- To point the client at a different authorization server (e.g., during development), add the following to your application's initializers:
54
+ To point the client at a different authorization server (e.g., during development), add the following to your application's initializers (or set the `APTIBLE_AUTH_ROOT_URL` environment variable):
55
55
 
56
56
  ```ruby
57
57
  Aptible::Auth.configure do |config|
@@ -9,7 +9,9 @@ module Aptible
9
9
  include GemConfig::Base
10
10
 
11
11
  with_configuration do
12
- has :root_url, classes: [String], default: 'https://auth.aptible.com'
12
+ has :root_url,
13
+ classes: [String],
14
+ default: ENV['APTIBLE_AUTH_ROOT_URL'] || 'https://auth.aptible.com'
13
15
  end
14
16
 
15
17
  def self.public_key
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Auth
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -7,6 +7,14 @@ describe Aptible::Auth do
7
7
  expect(config.root_url).to eq 'https://auth.aptible.com'
8
8
  end
9
9
 
10
+ pending 'uses ENV["APTIBLE_AUTH_ROOT_URL"] if defined' do
11
+ config = described_class.configuration
12
+ set_env 'APTIBLE_AUTH_ROOT_URL', 'http://foobar.com' do
13
+ config.reset
14
+ expect(config.root_url).to eq 'http://foobar.com'
15
+ end
16
+ end
17
+
10
18
  it 'should expose the server public key' do
11
19
  get = double 'get'
12
20
  Aptible::Auth::Client.any_instance.stub(:get) { get }
@@ -0,0 +1,10 @@
1
+ def set_env(*args, &block)
2
+ hash = args.first.is_a?(Hash) ? args.first : Hash[*args]
3
+ old_values = Hash[hash.map { |k, v| [k, ENV[k]] }]
4
+ begin
5
+ hash.each { |k, v| ENV[k] = v }
6
+ yield
7
+ ensure
8
+ old_values.each { |k, v| ENV[k] = v }
9
+ end
10
+ end
@@ -8,3 +8,7 @@ end
8
8
 
9
9
  # Require library up front
10
10
  require 'aptible/auth'
11
+
12
+ RSpec.configure do |config|
13
+ config.before { Aptible::Auth.configuration.reset }
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config
@@ -158,6 +158,7 @@ files:
158
158
  - spec/aptible/auth/client_spec.rb
159
159
  - spec/aptible/auth/token_spec.rb
160
160
  - spec/aptible/auth_spec.rb
161
+ - spec/shared/set_env.rb
161
162
  - spec/spec_helper.rb
162
163
  homepage: https://github.com/aptible/aptible-auth
163
164
  licenses:
@@ -187,4 +188,5 @@ test_files:
187
188
  - spec/aptible/auth/client_spec.rb
188
189
  - spec/aptible/auth/token_spec.rb
189
190
  - spec/aptible/auth_spec.rb
191
+ - spec/shared/set_env.rb
190
192
  - spec/spec_helper.rb