cerner-oauth1a 2.0.0.rc3 → 2.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/cerner/oauth1a/access_token_agent.rb +12 -5
- data/lib/cerner/oauth1a/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ee64e2771edfd3fddbeb7c0756f686b7bd559012f71d5682873e3c47004b638
|
4
|
+
data.tar.gz: 7555e415b1e141fc02a90b6763de9151dcb45b0f8189f50fa00c294a18a80005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cd2624142b1049335ddf5407cc0a752bee33de9c3a68eb4cdcf7d545bcb3a7e4ffd83681f5c61ca342a7016b1d775e334d1de140d8c5e60c2eb8603df6a0f72
|
7
|
+
data.tar.gz: 359b95df5aff7729180cc95dab1040c487dc1002c9271aa0e7321d217d37cc77dd24c09f2d93b8c200294f2a7ccecc09dfb6ddf96e0af670c567f91890f32b45
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# v2.0.0
|
2
2
|
Added APIs for authenticating Access Tokens, so that service providers can be implemented
|
3
|
-
with this library.
|
3
|
+
with this library. Additionally, caching mechanisms for AccessTokens and Keys has been
|
4
|
+
added.
|
4
5
|
|
5
6
|
Behavior changes:
|
7
|
+
* Caching of AccessTokens is on by default within Cerner::OAuth1a::AccessTokenAgent
|
6
8
|
* accessor_secret is no longer required to construct a Cerner::OAuth1a::AccessToken
|
7
9
|
* token_secret is no longer required to construct a Cerner::OAuth1a::AccessToken
|
8
10
|
* expires_at is no longer required to construct a Cerner::OAuth1a::AccessToken
|
@@ -86,16 +86,19 @@ module Cerner
|
|
86
86
|
#
|
87
87
|
# keys_version - The version identifier of the keys to retrieve. This corresponds to the
|
88
88
|
# KeysVersion parameter of the oauth_token.
|
89
|
+
# keywords - The additional, optional keyword arguments for this method
|
90
|
+
# :ignore_cache - A flag for indicating that the cache should be ignored and a
|
91
|
+
# new Access Token should be retrieved.
|
89
92
|
#
|
90
93
|
# Return a Keys instance upon success.
|
91
94
|
#
|
92
95
|
# Raises ArgumentError if keys_version is nil.
|
93
96
|
# Raises OAuthError for any functional errors returned within an HTTP 200 response.
|
94
97
|
# Raises StandardError sub-classes for any issues interacting with the service, such as networking issues.
|
95
|
-
def retrieve_keys(keys_version)
|
98
|
+
def retrieve_keys(keys_version, ignore_cache: false)
|
96
99
|
raise ArgumentError, 'keys_version is nil' unless keys_version
|
97
100
|
|
98
|
-
if @keys_cache
|
101
|
+
if @keys_cache && !ignore_cache
|
99
102
|
cache_entry = @keys_cache.get('cerner-oauth/keys', keys_version)
|
100
103
|
return cache_entry.value if cache_entry
|
101
104
|
end
|
@@ -111,15 +114,19 @@ module Cerner
|
|
111
114
|
# This method will use the #generate_accessor_secret, #generate_nonce and #generate_timestamp methods to
|
112
115
|
# interact with the service, which can be overridden via a sub-class, if desired.
|
113
116
|
#
|
114
|
-
#
|
117
|
+
# keywords - The additional, optional keyword arguments for this method
|
118
|
+
# :principal - An optional principal identifier, which is passed via the
|
119
|
+
# xoauth_principal protocol parameter.
|
120
|
+
# :ignore_cache - A flag for indicating that the cache should be ignored and a new
|
121
|
+
# Access Token should be retrieved.
|
115
122
|
#
|
116
123
|
# Returns a AccessToken upon success.
|
117
124
|
#
|
118
125
|
# Raises OAuthError for any functional errors returned within an HTTP 200 response.
|
119
126
|
# Raises StandardError sub-classes for any issues interacting with the service, such as networking issues.
|
120
|
-
def retrieve(principal
|
127
|
+
def retrieve(principal: nil, ignore_cache: false)
|
121
128
|
cache_key = "#{@consumer_key}&#{principal}"
|
122
|
-
if @access_token_cache
|
129
|
+
if @access_token_cache && !ignore_cache
|
123
130
|
cache_entry = @access_token_cache.get('cerner-oauth/access-tokens', cache_key)
|
124
131
|
return cache_entry.value if cache_entry
|
125
132
|
end
|