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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/concourse.rb +1 -0
- data/lib/concourse/models.rb +6 -0
- data/lib/concourse/models/token.rb +32 -0
- data/lib/concourse/sub_clients/skymarshal_client.rb +4 -4
- data/lib/concourse/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebf716759e328b59403cfd2b10d9c6a26c8b7c17ab373b226f6941e712076ddb
|
4
|
+
data.tar.gz: 7c8366afe14b256a551c8951e0687f3dcf3ec1487f915ef9f56129e99b68589d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02d9982cbe438aabb453c4c7979babc5ddb0f958687bd5c0379ef8de6da30d4922c047a11594e79ce00ad047ab982b3b7d50e50a58b4685f7bb21deba4e11b81
|
7
|
+
data.tar.gz: 418c7575d2816685ee5eca5d70585f44e9a35493d002683d59b3c25798f1c4efde9221014b556dfdc2f52ba860a797400d82bebe8700175e902de44a78151f4b
|
data/Gemfile.lock
CHANGED
data/lib/concourse.rb
CHANGED
@@ -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
|
data/lib/concourse/version.rb
CHANGED
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.
|
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-
|
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:
|
251
|
+
version: 1.3.1
|
250
252
|
requirements: []
|
251
253
|
rubygems_version: 3.0.1
|
252
254
|
signing_key:
|