g5_authentication_client 0.5.3 → 0.5.4

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: 7463214386cb26b951d8a2046fc473956679b4af
4
- data.tar.gz: e1d54d81273360a07c93795346943ad71e2e21dd
3
+ metadata.gz: 8d60929baecf0592863290945161331d89e59338
4
+ data.tar.gz: 9eedd2320dad57293882e6ca9f1941a0bdce3884
5
5
  SHA512:
6
- metadata.gz: 51a5fbf9a712e05f1c9ab9e977da28d30d99ae4dbe0ab9d561fea5df207e9ff7ce5569a501f888b2af0db94695494b18e1ca520c9352064079f066bbeed34836
7
- data.tar.gz: 71e4dc676d3734ba9b35049506222d2e94b282889bb51e396ec73b404955cdbb86abae0c499e9da15956b67ebfea9611031186935822cfc34ff5a70324ae2c8b
6
+ metadata.gz: 2431eeb76a1c45b38d2b83bb0fc463182dd537554ff19b1c4c2e4fbcad021e12f7eaf80dac95631d84e8d8cab8ab5bc01c0a3f10f81116bd4591e2f37285ec01
7
+ data.tar.gz: f8968bae4f7abfb7ed3f03a0dd20f63c18f6150cb34fa39767a7935d4351b4b54d03d9b2a01a4ab978f637b6b619dd94a244e410e1e45ad62ec92a98aceebd1d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.5.4 (2016-02-25)
2
+
3
+ * Add support for token `created_at` timestamp
4
+ ([#30](https://github.com/G5/g5_authentication_client/pull/30))
5
+
1
6
  ## v0.5.3
2
7
 
3
8
  * `Client#username_pw_access_token`: raise error when username/password are blank
data/README.md CHANGED
@@ -4,7 +4,7 @@ A client library for the g5-authentication service.
4
4
 
5
5
  ## Current version ##
6
6
 
7
- 0.5.1
7
+ 0.5.4
8
8
 
9
9
  ## Requirements ##
10
10
 
@@ -3,6 +3,8 @@ require 'modelish'
3
3
  module G5AuthenticationClient
4
4
  # G5 Authentication access token info
5
5
  class TokenInfo < Modelish::Base
6
+ ignore_unknown_properties!
7
+
6
8
  # @!attribute [rw] resource_owner_id
7
9
  # @return [String]
8
10
  # The ID of the user that owns the resource
@@ -23,5 +25,10 @@ module G5AuthenticationClient
23
25
  # The UID of the OAuth application that requested this token
24
26
  property :application_uid, from: :application,
25
27
  type: lambda { |val| (val[:uid] || val['uid']).to_s }
28
+
29
+ # @!attribute [rw] created_at
30
+ # @return [Time]
31
+ # The token creation timestamp
32
+ property :created_at, type: lambda { |val| Time.at(val.to_i) }
26
33
  end
27
34
  end
@@ -1,3 +1,3 @@
1
1
  module G5AuthenticationClient
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
@@ -9,7 +9,9 @@ describe G5AuthenticationClient::TokenInfo do
9
9
  resource_owner_id: resource_owner_id,
10
10
  scopes: scopes,
11
11
  expires_in_seconds: expires_in_seconds,
12
- application: { uid: application_uid }
12
+ application: { uid: application_uid },
13
+ created_at: created_at,
14
+ extra_attribute: 'some value'
13
15
  }
14
16
  end
15
17
 
@@ -17,6 +19,7 @@ describe G5AuthenticationClient::TokenInfo do
17
19
  let(:scopes) { ['leads','calls'] }
18
20
  let(:expires_in_seconds) { '3600' }
19
21
  let(:application_uid) { 'application-uid-42' }
22
+ let(:created_at) { Time.now.to_i }
20
23
 
21
24
  context 'with default initialization' do
22
25
  let(:attributes) {}
@@ -36,6 +39,14 @@ describe G5AuthenticationClient::TokenInfo do
36
39
  it 'should have nil application_uid' do
37
40
  expect(token.application_uid).to be_nil
38
41
  end
42
+
43
+ it 'should have nil created_at' do
44
+ expect(token.created_at).to be_nil
45
+ end
46
+
47
+ it 'should not have extra_attribute' do
48
+ expect(token).to_not respond_to(:extra_attribute)
49
+ end
39
50
  end
40
51
 
41
52
  context 'with full initialization' do
@@ -54,5 +65,13 @@ describe G5AuthenticationClient::TokenInfo do
54
65
  it 'should have application_uid' do
55
66
  expect(token.application_uid).to eq(application_uid)
56
67
  end
68
+
69
+ it 'should have created_at timestamp' do
70
+ expect(token.created_at).to eq(Time.at(created_at))
71
+ end
72
+
73
+ it 'should not have extra_attribute' do
74
+ expect(token).to_not respond_to(:extra_attribute)
75
+ end
57
76
  end
58
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_authentication_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Revels
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-19 00:00:00.000000000 Z
12
+ date: 2016-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: modelish
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  requirements: []
251
251
  rubyforge_project: g5_authentication_client
252
- rubygems_version: 2.4.8
252
+ rubygems_version: 2.4.6
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: Client for the G5 Auth service