apcera 0.1.6.6 → 0.1.6.7

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: 936f027a3af88048093ce9f9c12342d5cc26a429
4
- data.tar.gz: 64f8df1ba938aa87930e80faa5af4e2b40daa59c
3
+ metadata.gz: 129f14024acd34b352504b6d62bc36f917b37544
4
+ data.tar.gz: 27adcbba8c4dc3577439353ff507fdd25c510127
5
5
  SHA512:
6
- metadata.gz: 4bbab572fcd4550ad40d822683eae052e24881989fe653b6b49e23364905e32db6c1fd595d818d28f33418b3f25fc092cf69901e404656959f25706ed5de95bc
7
- data.tar.gz: 9e5324071aefd0beffe475983757371f4f9659eed51445f7f5468827597776dbda8df81488d78f68fc100d47f60818908268bdea083d2946a544e491aae682b3
6
+ metadata.gz: 8d62aa17d5251cc5e3b528f4acc9fb7c173c8809cc48858d3a826997f45bee78d4414d580d84627dd0042bf02ab16a210b1f131be50721681b356d3caa92cb7f
7
+ data.tar.gz: 21e7c4256f32c6a1cf4ae9245954ff9a5a69b3a932b2c388c41047b3f43dae65eb805453820ca0212004b2a74f9a71778034b1234a3d961145f4df3a36c0f170
@@ -1,3 +1,3 @@
1
1
  module Apcera
2
- VERSION = "0.1.6.6"
2
+ VERSION = "0.1.6.7"
3
3
  end
@@ -22,7 +22,8 @@ class String
22
22
  end
23
23
 
24
24
  class ApceraAuth
25
-
25
+ # Want to update this to check for HTTP_URI. If that is set, don't do ANY auth.
26
+ #
26
27
  # These are the bare minimum
27
28
  #
28
29
  attr_reader :target
@@ -72,14 +73,7 @@ class ApceraAuth
72
73
 
73
74
  default = "http://demo.proveapcera.io"
74
75
 
75
- # This can also be set in the environment
76
- #
77
- if ENV.key?("APC_TARGET")
78
- puts "WARNING: Using APC_TARGET from ENV"
79
- value = ENV["APC_TARGET"]
80
- else
81
- value = prompt_for_value("Enter the domain name for the cluster [#{default}] : ").delete!("\n")
82
- end
76
+ value = prompt_for_value("Enter the domain name for the cluster [#{default}] : ").delete!("\n")
83
77
 
84
78
  if value == ""
85
79
  value = default
@@ -104,6 +98,12 @@ class ApceraAuth
104
98
  @base_api_url = "#{scheme}://#{@api_host}"
105
99
  @base_auth_url = "#{scheme}://#{@auth_host}"
106
100
 
101
+ # if the $HTTP_URI is set then we are in app_token mode, and auth is done.
102
+ #
103
+ if (ENV.key?("$HTTP_URI"))
104
+ puts "HTTP_URI is set [#{ENV.key("$HTTP_URI")}], app_token mode"
105
+ end
106
+
107
107
  if (target.nonblank? || bearer.nonblank?)
108
108
  @bearer = bearer
109
109
  else
@@ -213,9 +213,17 @@ class ApceraApiHelper
213
213
 
214
214
  Apcera.configure do |config|
215
215
  config.scheme = apc_env.scheme
216
- config.api_key['authorization'] = apc_env.token
217
- config.api_key_prefix['authorization'] = apc_env.token_prefix
218
-
216
+
217
+ # If we are using APP_TOKEN these won't be set
218
+ #
219
+ if !apc_env.token.nil?
220
+ config.api_key['authorization'] = apc_env.token
221
+ end
222
+
223
+ if !apc_env.token_prefix.nil?
224
+ config.api_key_prefix['authorization'] = apc_env.token_prefix
225
+ end
226
+
219
227
  config.host = apc_env.api_host
220
228
  config.base_path = '/v1'
221
229
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apcera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6.6
4
+ version: 0.1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus