authlete 0.5.1 → 1.0.0

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/authlete.rb +24 -1
  3. data/lib/authlete/api.rb +298 -146
  4. data/lib/authlete/authentication-server.rb +1 -1
  5. data/lib/authlete/exception.rb +6 -3
  6. data/lib/authlete/model/client-extension.rb +135 -135
  7. data/lib/authlete/model/client-list.rb +128 -128
  8. data/lib/authlete/model/client.rb +468 -468
  9. data/lib/authlete/model/hashable.rb +1 -1
  10. data/lib/authlete/model/pair.rb +102 -102
  11. data/lib/authlete/model/property.rb +116 -0
  12. data/lib/authlete/model/request/authentication-callback-request.rb +90 -90
  13. data/lib/authlete/model/request/authorization-fail-request.rb +107 -104
  14. data/lib/authlete/model/request/authorization-issue-request.rb +167 -133
  15. data/lib/authlete/model/request/authorization-request.rb +101 -101
  16. data/lib/authlete/model/request/client-authorization-delete-request.rb +123 -0
  17. data/lib/authlete/model/request/client-authorization-get-list-request.rb +123 -0
  18. data/lib/authlete/model/request/client-authorization-update-request.rb +118 -0
  19. data/lib/authlete/model/request/client-secret-update-request.rb +121 -0
  20. data/lib/authlete/model/request/developer-authentication-callback-request.rb +84 -84
  21. data/lib/authlete/model/request/granted-scopes-request.rb +103 -0
  22. data/lib/authlete/model/request/introspection-request.rb +117 -39
  23. data/lib/authlete/model/request/revocation-request.rb +125 -0
  24. data/lib/authlete/model/request/standard-introspection-request.rb +102 -0
  25. data/lib/authlete/model/request/token-create-request.rb +250 -0
  26. data/lib/authlete/model/request/token-fail-request.rb +104 -101
  27. data/lib/authlete/model/request/token-issue-request.rb +116 -101
  28. data/lib/authlete/model/request/token-request.rb +127 -121
  29. data/lib/authlete/model/request/token-update-request.rb +165 -0
  30. data/lib/authlete/model/request/user-info-issue-request.rb +113 -0
  31. data/lib/authlete/model/request/user-info-request.rb +102 -0
  32. data/lib/authlete/model/response/authentication-callback-response.rb +53 -53
  33. data/lib/authlete/model/response/authorization-fail-response.rb +48 -48
  34. data/lib/authlete/model/response/authorization-issue-response.rb +85 -48
  35. data/lib/authlete/model/response/authorization-response.rb +177 -164
  36. data/lib/authlete/model/response/client-authorization-get-list-response.rb +60 -0
  37. data/lib/authlete/model/response/client-secret-refresh-response.rb +48 -0
  38. data/lib/authlete/model/response/client-secret-update-response.rb +48 -0
  39. data/lib/authlete/model/response/developer-authentication-callback-response.rb +55 -55
  40. data/lib/authlete/model/response/granted-scopes-get-response.rb +63 -0
  41. data/lib/authlete/model/response/introspection-response.rb +163 -132
  42. data/lib/authlete/model/response/revocation-response.rb +49 -0
  43. data/lib/authlete/model/response/service-creatable-response.rb +50 -50
  44. data/lib/authlete/model/response/standard-introspection-response.rb +49 -0
  45. data/lib/authlete/model/response/token-create-response.rb +100 -0
  46. data/lib/authlete/model/response/token-fail-response.rb +49 -49
  47. data/lib/authlete/model/response/token-issue-response.rb +138 -49
  48. data/lib/authlete/model/response/token-response.rb +168 -70
  49. data/lib/authlete/model/response/token-update-response.rb +62 -0
  50. data/lib/authlete/model/response/user-info-issue-response.rb +47 -0
  51. data/lib/authlete/model/response/user-info-response.rb +85 -0
  52. data/lib/authlete/model/result.rb +44 -44
  53. data/lib/authlete/model/scope.rb +1 -1
  54. data/lib/authlete/model/service-list.rb +1 -1
  55. data/lib/authlete/model/service-owner.rb +1 -1
  56. data/lib/authlete/model/service.rb +4 -2
  57. data/lib/authlete/model/sns-credentials.rb +1 -1
  58. data/lib/authlete/model/tagged-value.rb +97 -97
  59. data/lib/authlete/utility.rb +1 -1
  60. data/lib/authlete/version.rb +2 -2
  61. metadata +24 -2
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -549,8 +549,10 @@ module Authlete
549
549
 
550
550
  if authlete_model_simple_attribute?(key) or val.nil?
551
551
  hash[key] = val
552
- elsif val.kind_of?(Array)
552
+ elsif key == :developerSnsCredentials or key == :snsCredentials or key == :supportedScopes
553
553
  hash[key] = val.map { |element| element.to_hash }
554
+ elsif key == :metadata
555
+ hash[key] = val.to_hash
554
556
  end
555
557
  end
556
558
 
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,98 +1,98 @@
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 TaggedValue < Authlete::Model::Hashable
24
- # The language tag part. (String)
25
- attr_accessor :tag
26
-
27
- # The value part. (String)
28
- attr_accessor :value
29
-
30
- private
31
-
32
- # String attributes.
33
- STRING_ATTRIBUTES = ::Set.new([ :tag, :value ])
34
-
35
- # The constructor
36
- def initialize(hash = nil)
37
- # Set default values to string attributes.
38
- STRING_ATTRIBUTES.each do |attr|
39
- send("#{attr}=", nil)
40
- end
41
-
42
- # Set attribute values using the given hash.
43
- authlete_model_update(hash)
44
- end
45
-
46
- def authlete_model_convert_key(key)
47
- key.to_sym
48
- end
49
-
50
- def authlete_model_simple_attribute?(key)
51
- STRING_ATTRIBUTES.include?(key)
52
- end
53
-
54
- def authlete_model_update(hash)
55
- return if hash.nil?
56
-
57
- hash.each do |key, value|
58
- key = authlete_model_convert_key(key)
59
-
60
- # If the attribute is a simple one.
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, TaggedValue.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::TaggedValue.new(hash)
81
- end
82
-
83
- # Convert this object into a hash.
84
- def to_hash
85
- hash = {}
86
-
87
- instance_variables.each do |var|
88
- key = var.to_s.delete("@").to_sym
89
- val = instance_variable_get(var)
90
-
91
- hash[key] = val
92
- end
93
-
94
- hash
95
- end
96
- end
97
- end
1
+ # :nodoc:
2
+ #
3
+ # Copyright (C) 2014-2018 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 TaggedValue < Authlete::Model::Hashable
24
+ # The language tag part. (String)
25
+ attr_accessor :tag
26
+
27
+ # The value part. (String)
28
+ attr_accessor :value
29
+
30
+ private
31
+
32
+ # String attributes.
33
+ STRING_ATTRIBUTES = ::Set.new([ :tag, :value ])
34
+
35
+ # The constructor
36
+ def initialize(hash = nil)
37
+ # Set default values to string attributes.
38
+ STRING_ATTRIBUTES.each do |attr|
39
+ send("#{attr}=", nil)
40
+ end
41
+
42
+ # Set attribute values using the given hash.
43
+ authlete_model_update(hash)
44
+ end
45
+
46
+ def authlete_model_convert_key(key)
47
+ key.to_sym
48
+ end
49
+
50
+ def authlete_model_simple_attribute?(key)
51
+ STRING_ATTRIBUTES.include?(key)
52
+ end
53
+
54
+ def authlete_model_update(hash)
55
+ return if hash.nil?
56
+
57
+ hash.each do |key, value|
58
+ key = authlete_model_convert_key(key)
59
+
60
+ # If the attribute is a simple one.
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, TaggedValue.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::TaggedValue.new(hash)
81
+ end
82
+
83
+ # Convert this object into a hash.
84
+ def to_hash
85
+ hash = {}
86
+
87
+ instance_variables.each do |var|
88
+ key = var.to_s.delete("@").to_sym
89
+ val = instance_variable_get(var)
90
+
91
+ hash[key] = val
92
+ end
93
+
94
+ hash
95
+ end
96
+ end
97
+ end
98
98
  end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2015 Authlete, Inc.
3
+ # Copyright (C) 2014-2018 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module Authlete
19
- VERSION = "0.5.1"
19
+ VERSION = "1.0.0"
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.5.1
4
+ version: 1.0.0
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-10-02 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -75,25 +75,47 @@ files:
75
75
  - lib/authlete/model/client.rb
76
76
  - lib/authlete/model/hashable.rb
77
77
  - lib/authlete/model/pair.rb
78
+ - lib/authlete/model/property.rb
78
79
  - lib/authlete/model/request/authentication-callback-request.rb
79
80
  - lib/authlete/model/request/authorization-fail-request.rb
80
81
  - lib/authlete/model/request/authorization-issue-request.rb
81
82
  - lib/authlete/model/request/authorization-request.rb
83
+ - lib/authlete/model/request/client-authorization-delete-request.rb
84
+ - lib/authlete/model/request/client-authorization-get-list-request.rb
85
+ - lib/authlete/model/request/client-authorization-update-request.rb
86
+ - lib/authlete/model/request/client-secret-update-request.rb
82
87
  - lib/authlete/model/request/developer-authentication-callback-request.rb
88
+ - lib/authlete/model/request/granted-scopes-request.rb
83
89
  - lib/authlete/model/request/introspection-request.rb
90
+ - lib/authlete/model/request/revocation-request.rb
91
+ - lib/authlete/model/request/standard-introspection-request.rb
92
+ - lib/authlete/model/request/token-create-request.rb
84
93
  - lib/authlete/model/request/token-fail-request.rb
85
94
  - lib/authlete/model/request/token-issue-request.rb
86
95
  - lib/authlete/model/request/token-request.rb
96
+ - lib/authlete/model/request/token-update-request.rb
97
+ - lib/authlete/model/request/user-info-issue-request.rb
98
+ - lib/authlete/model/request/user-info-request.rb
87
99
  - lib/authlete/model/response/authentication-callback-response.rb
88
100
  - lib/authlete/model/response/authorization-fail-response.rb
89
101
  - lib/authlete/model/response/authorization-issue-response.rb
90
102
  - lib/authlete/model/response/authorization-response.rb
103
+ - lib/authlete/model/response/client-authorization-get-list-response.rb
104
+ - lib/authlete/model/response/client-secret-refresh-response.rb
105
+ - lib/authlete/model/response/client-secret-update-response.rb
91
106
  - lib/authlete/model/response/developer-authentication-callback-response.rb
107
+ - lib/authlete/model/response/granted-scopes-get-response.rb
92
108
  - lib/authlete/model/response/introspection-response.rb
109
+ - lib/authlete/model/response/revocation-response.rb
93
110
  - lib/authlete/model/response/service-creatable-response.rb
111
+ - lib/authlete/model/response/standard-introspection-response.rb
112
+ - lib/authlete/model/response/token-create-response.rb
94
113
  - lib/authlete/model/response/token-fail-response.rb
95
114
  - lib/authlete/model/response/token-issue-response.rb
96
115
  - lib/authlete/model/response/token-response.rb
116
+ - lib/authlete/model/response/token-update-response.rb
117
+ - lib/authlete/model/response/user-info-issue-response.rb
118
+ - lib/authlete/model/response/user-info-response.rb
97
119
  - lib/authlete/model/result.rb
98
120
  - lib/authlete/model/scope.rb
99
121
  - lib/authlete/model/service-list.rb