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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2a4ccfde185aca59fd7d639c4f15db74883c8932d38cc461b4ec1ad38a86e95
4
- data.tar.gz: 051e4b68e33bdff8b347f5ec044e2d2a234455a49d6e9b1eef8487973c87fd3f
3
+ metadata.gz: 1ee64e2771edfd3fddbeb7c0756f686b7bd559012f71d5682873e3c47004b638
4
+ data.tar.gz: 7555e415b1e141fc02a90b6763de9151dcb45b0f8189f50fa00c294a18a80005
5
5
  SHA512:
6
- metadata.gz: 43460c5fe1996222164227d1fb8d98a93b7cedb16cf2dd6703a6e89324daab116a0c8994ebb13249aa8c5f8afa8fa5e708b8448ff0ef0d0d533924920d900688
7
- data.tar.gz: 23fcbc356390d70b89dc1df139b6edb680e8077521b6b475916bc85f77312fd6b3e3777be9e30c2bc03bfcbe52179200198cefaada61a2c338335770d7935045
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
- # principal - An optional principal identifier, which is passed via the xoauth_principal protocol parameter.
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 = nil)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cerner
4
4
  module OAuth1a
5
- VERSION = '2.0.0.rc3'
5
+ VERSION = '2.0.0.rc4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cerner-oauth1a
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc3
4
+ version: 2.0.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Beyer