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 +4 -4
- data/CHANGELOG.md +4 -0
- data/example/lib/my_api/api_config.rb +2 -0
- data/lib/ncore/client.rb +5 -1
- data/lib/ncore/configuration.rb +2 -0
- data/lib/ncore/version.rb +1 -1
- data/ncore.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a53992fec3f5b7043eedd61c79135ac544a36f8
|
4
|
+
data.tar.gz: d21cfd09a783d46553b32c7a52595e94aec0db85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de345413107a0c70db01e4077ebb8b75d79cb1fcee660d0aaf2920b60e956937a1bcd17f1f0ad90ee0f25279866eaeadc238eb1417965c1d776596eb468a0915
|
7
|
+
data.tar.gz: d45da4022fde6e2353047c4b1d7ef23ac445886fc04a3252cbdb3546bba7148cc81e9cef7d4614a2e40928e940dfbf0ccd6ffa5ece4855679c7c36126fb45123
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/ncore/client.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/ncore/configuration.rb
CHANGED
@@ -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
|
|
data/lib/ncore/version.rb
CHANGED
data/ncore.gemspec
CHANGED
@@ -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 = '
|
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
|
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-
|
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:
|
123
|
+
homepage: https://notioneer.com/
|
124
124
|
licenses:
|
125
125
|
- MIT
|
126
126
|
metadata: {}
|