concourse.rb 0.2.0 → 0.3.0.pre.1

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: e418cdfd2f7f6b6dcedd8ca3d7a9131bc604c2c6cd855f917a0aeebdb85e9b12
4
- data.tar.gz: 6089cc188fcbcf8f6733d8f5f8d79acc13e79806f25e260854831264fdbc2ea2
3
+ metadata.gz: ebf716759e328b59403cfd2b10d9c6a26c8b7c17ab373b226f6941e712076ddb
4
+ data.tar.gz: 7c8366afe14b256a551c8951e0687f3dcf3ec1487f915ef9f56129e99b68589d
5
5
  SHA512:
6
- metadata.gz: 94cf6b94a5a7d55bc53170ea34defdf80baa44023f23b9b72ed199c59907e91c59a15200bfd46a627d51b32be85dd289bedcd79ad0914424d60c0029aeeb8058
7
- data.tar.gz: cbcd88a607aa38e55f7253813f57410c054137f58f869241630eb1aa0c7f2c41aa55bc7dc23cd192ea679851ac0d084dd54257883de9ecada5521874e2cf1b55
6
+ metadata.gz: 02d9982cbe438aabb453c4c7979babc5ddb0f958687bd5c0379ef8de6da30d4922c047a11594e79ce00ad047ab982b3b7d50e50a58b4685f7bb21deba4e11b81
7
+ data.tar.gz: 418c7575d2816685ee5eca5d70585f44e9a35493d002683d59b3c25798f1c4efde9221014b556dfdc2f52ba860a797400d82bebe8700175e902de44a78151f4b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- concourse.rb (0.2.0)
4
+ concourse.rb (0.3.0.pre.1)
5
5
  dry-schema (~> 0.5)
6
6
  excon (~> 0.72)
7
7
  semantic (~> 1.5)
@@ -1,4 +1,5 @@
1
1
  require_relative 'concourse/version'
2
+ require_relative 'concourse/models'
2
3
  require_relative 'concourse/client'
3
4
  require_relative 'concourse/urls'
4
5
  require_relative 'concourse/headers'
@@ -0,0 +1,6 @@
1
+ require 'concourse/models/token'
2
+
3
+ module Concourse
4
+ module Models
5
+ end
6
+ end
@@ -0,0 +1,32 @@
1
+ module Concourse
2
+ module Models
3
+ class Token
4
+ attr_reader :access_token, :token_type, :expires_at, :id_token
5
+
6
+ def initialize(parameters)
7
+ @access_token = parameters[:access_token]
8
+ @token_type = parameters[:token_type]
9
+ @expires_at = parameters[:expires_at]
10
+ @id_token = parameters[:id_token]
11
+ end
12
+
13
+ def ==(other)
14
+ other.class == self.class && other.state == state
15
+ end
16
+
17
+ def eql?(other)
18
+ self == other
19
+ end
20
+
21
+ def hash
22
+ state.hash
23
+ end
24
+
25
+ protected
26
+
27
+ def state
28
+ [@access_token, @token_type, @expires_at, @id_token]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -77,20 +77,20 @@ module Concourse
77
77
  JSON.parse(token_response.body, symbolize_names: true)
78
78
 
79
79
  @version >= VERSION_6_1 ?
80
- {
80
+ Models::Token.new(
81
81
  access_token: token_response_body[:access_token],
82
82
  token_type: token_response_body[:token_type].downcase,
83
83
  expires_at:
84
84
  (token_response_date + token_response_body[:expires_in])
85
85
  .iso8601,
86
86
  id_token: token_response_body[:id_token]
87
- } :
88
- {
87
+ ) :
88
+ Models::Token.new(
89
89
  access_token: token_response_body[:access_token],
90
90
  token_type: token_response_body[:token_type].downcase,
91
91
  expires_at: token_response_body[:expiry],
92
92
  id_token: token_response_body[:access_token]
93
- }
93
+ )
94
94
  end
95
95
  end
96
96
  end
@@ -1,3 +1,3 @@
1
1
  module Concourse
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0.pre.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concourse.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-03 00:00:00.000000000 Z
11
+ date: 2021-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -225,6 +225,8 @@ files:
225
225
  - lib/concourse.rb
226
226
  - lib/concourse/client.rb
227
227
  - lib/concourse/headers.rb
228
+ - lib/concourse/models.rb
229
+ - lib/concourse/models/token.rb
228
230
  - lib/concourse/sub_clients.rb
229
231
  - lib/concourse/sub_clients/skymarshal_client.rb
230
232
  - lib/concourse/urls.rb
@@ -244,9 +246,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
244
246
  version: 2.6.0
245
247
  required_rubygems_version: !ruby/object:Gem::Requirement
246
248
  requirements:
247
- - - ">="
249
+ - - ">"
248
250
  - !ruby/object:Gem::Version
249
- version: '0'
251
+ version: 1.3.1
250
252
  requirements: []
251
253
  rubygems_version: 3.0.1
252
254
  signing_key: