authlete 0.4.4 → 0.4.5

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: 51f422fdb9d470f829c32dccd39f1fcf3e9526a1
4
- data.tar.gz: 58c32fcc3f59728bdb36261022aec5c855edcf38
3
+ metadata.gz: ef1a6c543fcb76bedce08190e164ef4afa738a3c
4
+ data.tar.gz: 4f64bae2040be8090b0c2f351d64183762a00b75
5
5
  SHA512:
6
- metadata.gz: 20b1b910cc4f7f8b0f7440edf00c440082442d4e577a3e5188db477c0cbda0bfa5e9fae03bceaac7fd6bf13992a7bcef61351bd1f14222d794068c37284108f3
7
- data.tar.gz: a7232fcaa7ef505f92a2712b6969d359196429316e227b261a60f4db5897abe9453073a0074e1f5036b774451d5e57b56c0e2b05c478f490431a4c997c736323
6
+ metadata.gz: 5261e07397a1abd749201d1077d57501aacd438ea80a3941334d947b28fbe3c97c8c7a4998953ea97876554967926ddea9c284db33459455c18d7fae5406413a
7
+ data.tar.gz: 668a63e3eec779ba8e816e5671c96e19977a9da6e8dddf3560367cf0b050ec01f0f07f1ef2d9eba915ac5b65cefc3a47ec0a4f59c402db5c5b3d8179dd234b05
@@ -28,11 +28,12 @@ module Authlete
28
28
  autoload :Utility, 'authlete/utility'
29
29
 
30
30
  module Model
31
- autoload :Hashable, 'authlete/model/hashable'
32
31
  autoload :Client, 'authlete/model/client'
33
32
  autoload :ClientList, 'authlete/model/client-list'
34
33
  autoload :ClientExtension, 'authlete/model/client-extension'
34
+ autoload :Hashable, 'authlete/model/hashable'
35
35
  autoload :Result, 'authlete/model/result'
36
+ autoload :Pair, 'authlete/model/pair'
36
37
  autoload :Scope, 'authlete/model/scope'
37
38
  autoload :Service, 'authlete/model/service'
38
39
  autoload :ServiceList, 'authlete/model/service-list'
@@ -49,7 +50,7 @@ module Authlete
49
50
  autoload :IntrospectionRequest, 'authlete/model/request/introspection-request'
50
51
  autoload :TokenFailRequest, 'authlete/model/request/token-fail-request'
51
52
  autoload :TokenIssueRequest, 'authlete/model/request/token-issue-request'
52
- autoload :TokenReqeust, 'authlete/model/request/token-request'
53
+ autoload :TokenRequest, 'authlete/model/request/token-request'
53
54
  end
54
55
 
55
56
  module Response
@@ -0,0 +1,103 @@
1
+ # :nodoc:
2
+ #
3
+ # Copyright (C) 2014-2015 Authlete, Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+
18
+ require 'set'
19
+
20
+
21
+ module Authlete
22
+ module Model
23
+ class Pair < Authlete::Model::Hashable
24
+ include Authlete::Utility
25
+ # The key of this pair. (String)
26
+ attr_accessor :key
27
+
28
+ # The value of this pair. (String)
29
+ attr_accessor :value
30
+
31
+ private
32
+
33
+ # String attributes.
34
+ STRING_ATTRIBUTES = ::Set.new([ :key, :value ])
35
+
36
+ # The constructor
37
+ def initialize(hash = nil)
38
+ # Set default values to string attributes.
39
+ STRING_ATTRIBUTES.each do |attr|
40
+ send("#{attr}=", nil)
41
+ end
42
+
43
+ # Set attribute values using the given hash.
44
+ authlete_model_update(hash)
45
+ end
46
+
47
+ def authlete_model_convert_key(key)
48
+ key.to_sym
49
+ end
50
+
51
+ def authlete_model_simple_attribute?(key)
52
+ STRING_ATTRIBUTES.include?(key)
53
+ end
54
+
55
+ def authlete_model_update(hash)
56
+ return if hash.nil?
57
+
58
+ hash.each do |key, value|
59
+ key = authlete_model_convert_key(key)
60
+
61
+ if authlete_model_simple_attribute?(key)
62
+ send("#{key}=", value)
63
+ end
64
+ end
65
+
66
+ self
67
+ end
68
+
69
+ public
70
+
71
+ # Construct an instance from the given hash.
72
+ #
73
+ # If the given argument is nil or is not a Hash, nil is returned.
74
+ # Otherwise, Scope.new(hash) is returned.
75
+ def self.parse(hash)
76
+ if hash.nil? or (hash.kind_of?(Hash) == false)
77
+ return nil
78
+ end
79
+
80
+ Authlete::Model::Pair.new(hash)
81
+ end
82
+
83
+ # Set attribute values using the given hash.
84
+ def update(hash)
85
+ authlete_model_update(hash)
86
+ end
87
+
88
+ # Convert this object into a hash.
89
+ def to_hash
90
+ hash = {}
91
+
92
+ instance_variables.each do |var|
93
+ key = var.to_s.delete("@").to_sym
94
+ val = instance_variable_get(var)
95
+
96
+ hash[key] = val
97
+ end
98
+
99
+ hash
100
+ end
101
+ end
102
+ end
103
+ end
@@ -152,6 +152,9 @@ module Authlete
152
152
  alias_method :jwks_uri, :jwksUri
153
153
  alias_method :jwks_uri=, :jwksUri=
154
154
 
155
+ # The metadata of the service. (Pair Array)
156
+ attr_accessor :metadata
157
+
155
158
  # The timestamp at which the service was modified. (Integer)
156
159
  attr_accessor :modifiedAt
157
160
  alias_method :modified_at, :modifiedAt
@@ -173,9 +176,6 @@ module Authlete
173
176
  alias_method :policy_uri, :policyUri
174
177
  alias_method :policy_uri=, :policyUri=
175
178
 
176
- # The service properties. (Array)
177
- attr_accessor :properties
178
-
179
179
  # The duration of refresh tokens in seconds. (Integer)
180
180
  attr_accessor :refreshTokenDuration
181
181
  alias_method :refresh_token_duration, :refreshTokenDuration
@@ -340,7 +340,7 @@ module Authlete
340
340
 
341
341
  # String array attributes.
342
342
  STRING_ARRAY_ATTRIBUTES = ::Set.new([
343
- :properties, :supportedAcrs, :supportedClaimLocales, :supportedClaims,
343
+ :supportedAcrs, :supportedClaimLocales, :supportedClaims,
344
344
  :supportedClaimTypes, :supportedDeveloperSnses, :supportedDisplays,
345
345
  :supportedGrantTypes, :supportedResponseTypes, :supportedSnses,
346
346
  :supportedTokenAuthMethods, :supportedUiLocales
@@ -422,6 +422,7 @@ module Authlete
422
422
 
423
423
  # Set default values to special objects.
424
424
  @developerSnsCredentials = nil
425
+ @metadata = nil
425
426
  @snsCredentials = nil
426
427
  @supportedScopes = nil
427
428
 
@@ -459,6 +460,10 @@ module Authlete
459
460
  @developerSnsCredentials = get_parsed_array(value) do |element|
460
461
  Authlete::Model::SnsCredentials.parse(element)
461
462
  end
463
+ elsif key == :metadata
464
+ @metadata = get_parsed_array(value) do |element|
465
+ Authlete::Model::Pair.parse(element)
466
+ end
462
467
  elsif key == :snsCredentials
463
468
  @snsCredentials = get_parsed_array(value) do |element|
464
469
  Authlete::Model::SnsCredentials.parse(element)
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module Authlete
19
- VERSION = "0.4.4"
19
+ VERSION = "0.4.5"
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authlete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiko Kawasaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-12 00:00:00.000000000 Z
11
+ date: 2017-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -74,6 +74,7 @@ files:
74
74
  - lib/authlete/model/client-list.rb
75
75
  - lib/authlete/model/client.rb
76
76
  - lib/authlete/model/hashable.rb
77
+ - lib/authlete/model/pair.rb
77
78
  - lib/authlete/model/request/authentication-callback-request.rb
78
79
  - lib/authlete/model/request/authorization-fail-request.rb
79
80
  - lib/authlete/model/request/authorization-issue-request.rb