ncore 2.0.8 → 2.1.0

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: 77f85d81de1f0ce86e1a09f076021fe12adc8d57
4
- data.tar.gz: 9db4b0c8b58008e3c445e9290a41e040c40e6355
3
+ metadata.gz: 8a53992fec3f5b7043eedd61c79135ac544a36f8
4
+ data.tar.gz: d21cfd09a783d46553b32c7a52595e94aec0db85
5
5
  SHA512:
6
- metadata.gz: e2f49e2eaf63da42622eaf01fc31a8681c3d4809220a5a2be5fb2b9a85b5662357f3406d0ed2c88f4b1e14cce0dc693a616b7a031fd9398de7e96b87e1a4d630
7
- data.tar.gz: eb3464245363c1b55a8c497ba7fd63b52cc4c3189abb0aeadc758c05ecba6332b6e0711648a30f322e5f237049f44200a649485ca12c449f2d49d187ba94a9e0
6
+ metadata.gz: de345413107a0c70db01e4077ebb8b75d79cb1fcee660d0aaf2920b60e956937a1bcd17f1f0ad90ee0f25279866eaeadc238eb1417965c1d776596eb468a0915
7
+ data.tar.gz: d45da4022fde6e2353047c4b1d7ef23ac445886fc04a3252cbdb3546bba7148cc81e9cef7d4614a2e40928e940dfbf0ccd6ffa5ece4855679c7c36126fb45123
@@ -1,3 +1,7 @@
1
+ #### 2.1.0
2
+
3
+ - Add ability to produce Authorization headers
4
+
1
5
  #### 2.0.8
2
6
 
3
7
  - Properly handle grandchild credentials objects
@@ -27,6 +27,8 @@ module MyApi
27
27
 
28
28
  self.auth_header_prefix = 'X-MyApi'
29
29
 
30
+ # self.bearer_credential_key = :api_key
31
+
30
32
  self.credentials_error_message = %Q{Missing API credentials. Set default credentials using "MyApi.credentials = {api_user: YOUR_API_USER, api_key: YOUR_API_KEY}"}
31
33
  end
32
34
 
@@ -283,7 +283,11 @@ module NCore
283
283
  def auth_headers(creds)
284
284
  creds.inject({}) do |h,(k,v)|
285
285
  if v.present?
286
- h["#{auth_header_prefix}-#{k}"] = v
286
+ if k == bearer_credential_key
287
+ h["Authorization"] = "Bearer #{v}"
288
+ else
289
+ h["#{auth_header_prefix}-#{k}"] = v
290
+ end
287
291
  end
288
292
  h
289
293
  end
@@ -37,6 +37,8 @@ module NCore
37
37
  mattr_accessor :auth_header_prefix
38
38
  self.auth_header_prefix = 'X-Api'
39
39
 
40
+ mattr_accessor :bearer_credential_key
41
+
40
42
  mattr_accessor :credentials_error_message
41
43
  self.credentials_error_message = %Q{Missing API credentials. Set default credentials using "#{self.parent.name}.credentials = {api_user: YOUR_API_USER, api_key: YOUR_API_KEY}"}
42
44
 
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '2.0.8'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["hello@notioneer.com"]
11
11
  spec.description = %q{NCore - Ruby gem useful for building REST API clients}
12
12
  spec.summary = %q{NCore - Gem for building REST API clients}
13
- spec.homepage = 'http://notioneer.com/'
13
+ spec.homepage = 'https://notioneer.com/'
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-22 00:00:00.000000000 Z
11
+ date: 2017-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -120,7 +120,7 @@ files:
120
120
  - lib/ncore/util.rb
121
121
  - lib/ncore/version.rb
122
122
  - ncore.gemspec
123
- homepage: http://notioneer.com/
123
+ homepage: https://notioneer.com/
124
124
  licenses:
125
125
  - MIT
126
126
  metadata: {}