authlete 0.4.1 → 0.4.2
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 +4 -4
- data/lib/authlete.rb +0 -1
- data/lib/authlete/authentication-server.rb +1 -1
- data/lib/authlete/model/client.rb +1 -1
- data/lib/authlete/model/request/authorization-request.rb +1 -1
- data/lib/authlete/model/request/developer-authentication-callback-request.rb +1 -1
- data/lib/authlete/model/request/introspection-request.rb +1 -1
- data/lib/authlete/model/request/token-issue-request.rb +1 -1
- data/lib/authlete/model/request/token-request.rb +1 -1
- data/lib/authlete/model/response/authorization-issue-response.rb +1 -1
- data/lib/authlete/model/response/authorization-response.rb +1 -1
- data/lib/authlete/model/response/introspection-response.rb +1 -1
- data/lib/authlete/model/response/token-fail-response.rb +1 -1
- data/lib/authlete/model/response/token-issue-response.rb +1 -1
- data/lib/authlete/model/scope.rb +25 -1
- data/lib/authlete/model/tagged-value.rb +2 -9
- data/lib/authlete/version.rb +1 -1
- metadata +2 -3
- data/lib/authlete/host.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab0dea663641f59f6f122fb29dcf71efb7f2cec8
|
4
|
+
data.tar.gz: c54970c03b22d27edaaa072b174a4512e8cf8067
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20ed509dc656372f88babd36d812969c58e333c08675df697d52bad23802e572be239decbbff89db509cc95b8b6c69390ae83f89a95eb6a056e20b6ed8c00dd6
|
7
|
+
data.tar.gz: 962d058d75905062b4721d361ea0288483fbb5954c4542a50cd742634d03560a474dc192c91a3036e3f185304954915cbad7b3e76dd4dd2e69e25af00ab707db
|
data/lib/authlete.rb
CHANGED
@@ -247,7 +247,7 @@ module Authlete
|
|
247
247
|
# (String)
|
248
248
|
attr_accessor :description
|
249
249
|
|
250
|
-
# Descriptions about the client application with language tags. (
|
250
|
+
# Descriptions about the client application with language tags. (TaggedValue array)
|
251
251
|
attr_accessor :descriptions
|
252
252
|
|
253
253
|
# The timestamp at which the client was created. (Integer)
|
data/lib/authlete/model/scope.rb
CHANGED
@@ -21,9 +21,14 @@ require 'set'
|
|
21
21
|
module Authlete
|
22
22
|
module Model
|
23
23
|
class Scope < Authlete::Model::Hashable
|
24
|
+
include Authlete::Utility
|
24
25
|
# The description about this scope. (String)
|
25
26
|
attr_accessor :description
|
26
27
|
|
28
|
+
# The descriptions about this scope with language tags.
|
29
|
+
# (TaggedValue array)
|
30
|
+
attr_accessor :descriptions
|
31
|
+
|
27
32
|
# The name of this scope. (String)
|
28
33
|
attr_accessor :name
|
29
34
|
|
@@ -41,6 +46,9 @@ module Authlete
|
|
41
46
|
# String attributes.
|
42
47
|
STRING_ATTRIBUTES = ::Set.new([ :description, :name ])
|
43
48
|
|
49
|
+
# Tagged value array attributes.
|
50
|
+
TAGGED_VALUE_ARRAY_ATTRIBUTES = ::Set.new([ :descriptions ])
|
51
|
+
|
44
52
|
# Mapping from snake cases to camel cases.
|
45
53
|
SNAKE_TO_CAMEL = { :default_entry => :defaultEntry }
|
46
54
|
|
@@ -56,6 +64,11 @@ module Authlete
|
|
56
64
|
send("#{attr}=", nil)
|
57
65
|
end
|
58
66
|
|
67
|
+
# Set default values to tagged value array attributes.
|
68
|
+
TAGGED_VALUE_ARRAY_ATTRIBUTES.each do |attr|
|
69
|
+
send("#{attr}=", nil)
|
70
|
+
end
|
71
|
+
|
59
72
|
# Set attribute values using the given hash.
|
60
73
|
authlete_model_update(hash)
|
61
74
|
end
|
@@ -84,6 +97,13 @@ module Authlete
|
|
84
97
|
|
85
98
|
if authlete_model_simple_attribute?(key)
|
86
99
|
send("#{key}=", value)
|
100
|
+
elsif TAGGED_VALUE_ARRAY_ATTRIBUTES.include?(key)
|
101
|
+
# Get an array consisting of "TaggedValue" objects.
|
102
|
+
parsed = get_parsed_array(value) do |element|
|
103
|
+
Authlete::Model::TaggedValue.parse(element)
|
104
|
+
end
|
105
|
+
|
106
|
+
send("#{key}=", parsed)
|
87
107
|
end
|
88
108
|
end
|
89
109
|
|
@@ -117,7 +137,11 @@ module Authlete
|
|
117
137
|
key = var.to_s.delete("@").to_sym
|
118
138
|
val = instance_variable_get(var)
|
119
139
|
|
120
|
-
|
140
|
+
if authlete_model_simple_attribute?(key) or val.nil?
|
141
|
+
hash[key] = val
|
142
|
+
elsif val.kind_of?(Array)
|
143
|
+
hash[key] = val.map { |element| element.to_hash }
|
144
|
+
end
|
121
145
|
end
|
122
146
|
|
123
147
|
hash
|
@@ -30,7 +30,7 @@ module Authlete
|
|
30
30
|
private
|
31
31
|
|
32
32
|
# String attributes.
|
33
|
-
STRING_ATTRIBUTES = ::Set.new([:tag, :value])
|
33
|
+
STRING_ATTRIBUTES = ::Set.new([ :tag, :value ])
|
34
34
|
|
35
35
|
# The constructor
|
36
36
|
def initialize(hash = nil)
|
@@ -44,14 +44,7 @@ module Authlete
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def authlete_model_convert_key(key)
|
47
|
-
key
|
48
|
-
|
49
|
-
# Convert snakecase to camelcase, if necessary.
|
50
|
-
if SNAKE_TO_CAMEL.has_key?(key)
|
51
|
-
key = SNAKE_TO_CAMEL[key]
|
52
|
-
end
|
53
|
-
|
54
|
-
key
|
47
|
+
key.to_sym
|
55
48
|
end
|
56
49
|
|
57
50
|
def authlete_model_simple_attribute?(key)
|
data/lib/authlete/version.rb
CHANGED
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
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- lib/authlete/api.rb
|
71
71
|
- lib/authlete/authentication-server.rb
|
72
72
|
- lib/authlete/exception.rb
|
73
|
-
- lib/authlete/host.rb
|
74
73
|
- lib/authlete/model/client-list.rb
|
75
74
|
- lib/authlete/model/client.rb
|
76
75
|
- lib/authlete/model/hashable.rb
|
data/lib/authlete/host.rb
DELETED
@@ -1,23 +0,0 @@
|
|
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
|
-
module Authlete
|
19
|
-
module Host
|
20
|
-
DEVELOPMENT = 'https://dev-api.authlete.com'
|
21
|
-
PRODUCTION = 'https://api.authlete.com'
|
22
|
-
end
|
23
|
-
end
|