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,49 +1,49 @@
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 Model
20
- module Response
21
- # == Authlete::Model::Response::AuthorizationFailResponse class
22
- #
23
- # This class represents a response from Authlete's /api/auth/authorization/fail API.
24
- class AuthorizationFailResponse < Authlete::Model::Result
25
- # The next action that the service implementation should take.
26
- # (String)
27
- attr_accessor :action
28
-
29
- # The response content which can be used to generate a response
30
- # to the client application. The format of the value varies
31
- # depending on the value of "action". (String)
32
- attr_accessor :responseContent
33
- alias_method :response_content, :responseContent
34
- alias_method :response_content=, :responseContent=
35
-
36
- private
37
-
38
- # The constructor which takes a hash that represents a JSON response
39
- # from Authlete's /api/auth/authorization/fail API.
40
- def initialize(hash = {})
41
- super(hash)
42
-
43
- @action = extract_value(hash, :action)
44
- @responseContent = extract_value(hash, :responseContent)
45
- end
46
- end
47
- end
48
- 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
+ module Authlete
19
+ module Model
20
+ module Response
21
+ # == Authlete::Model::Response::AuthorizationFailResponse class
22
+ #
23
+ # This class represents a response from Authlete's /api/auth/authorization/fail API.
24
+ class AuthorizationFailResponse < Authlete::Model::Result
25
+ # The next action that the service implementation should take.
26
+ # (String)
27
+ attr_accessor :action
28
+
29
+ # The response content which can be used to generate a response
30
+ # to the client application. The format of the value varies
31
+ # depending on the value of "action". (String)
32
+ attr_accessor :responseContent
33
+ alias_method :response_content, :responseContent
34
+ alias_method :response_content=, :responseContent=
35
+
36
+ private
37
+
38
+ # The constructor which takes a hash that represents a JSON response
39
+ # from Authlete's /api/auth/authorization/fail API.
40
+ def initialize(hash = {})
41
+ super(hash)
42
+
43
+ @action = extract_value(hash, :action)
44
+ @responseContent = extract_value(hash, :responseContent)
45
+ end
46
+ end
47
+ end
48
+ end
49
49
  end
@@ -1,49 +1,86 @@
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 Model
20
- module Response
21
- # == Authlete::Model::Response::AuthorizationIssueResponse class
22
- #
23
- # This class represents a response from Authlete's /api/auth/authorization/issue API.
24
- class AuthorizationIssueResponse < Authlete::Model::Result
25
- # The next action that the service implementation should take.
26
- # (String)
27
- attr_accessor :action
28
-
29
- # The response content which can be used to generate a response
30
- # to the client application. The format of the value varies
31
- # depending on the value of "action". (String)
32
- attr_accessor :responseContent
33
- alias_method :response_content, :responseContent
34
- alias_method :response_content=, :responseContent=
35
-
36
- private
37
-
38
- # The constructor which takes a hash that represents a JSON response
39
- # from Authlete's /api/auth/authorization/issue API.
40
- def initialize(hash = {})
41
- super(hash)
42
-
43
- @action = extract_value(hash, :action)
44
- @responseContent = extract_value(hash, :responseContent)
45
- end
46
- end
47
- end
48
- 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
+ module Authlete
19
+ module Model
20
+ module Response
21
+ # == Authlete::Model::Response::AuthorizationIssueResponse class
22
+ #
23
+ # This class represents a response from Authlete's /api/auth/authorization/issue API.
24
+ class AuthorizationIssueResponse < Authlete::Model::Result
25
+ # The next action that the service implementation should take.
26
+ # (String)
27
+ attr_accessor :action
28
+
29
+ # The response content which can be used to generate a response
30
+ # to the client application. The format of the value varies
31
+ # depending on the value of "action". (String)
32
+ attr_accessor :responseContent
33
+ alias_method :response_content, :responseContent
34
+ alias_method :response_content=, :responseContent=
35
+
36
+ # The newly issued access token. Note that an access token is issued
37
+ # from an Authorization Endpoint only when "response_type" contains "token".
38
+ # (String)
39
+ attr_accessor :accessToken
40
+ alias_method :access_token, :accessToken
41
+ alias_method :access_token=, :accessToken=
42
+
43
+ # The datetime at which the newly issued access token will expire.
44
+ # The value is represented in milliseconds since the Unix epoch (1970-01-01).
45
+ # (Integer)
46
+ attr_accessor :accessTokenExpiresAt
47
+ alias_method :access_token_expires_at, :accessTokenExpiresAt
48
+ alias_method :access_token_expires_at=, :accessTokenExpiresAt=
49
+
50
+ # The duration of the newly issued access token in seconds. (Integer)
51
+ attr_accessor :accessTokenDuration
52
+ alias_method :access_token_duration, :accessTokenDuration
53
+ alias_method :access_token_duration=, :accessTokenDuration=
54
+
55
+ # The newly issued ID token. Note that an ID token is issued from
56
+ # an Authorization Endpoint only when "response_type" contains "id_token".
57
+ # (String)
58
+ attr_accessor :idToken
59
+ alias_method :id_token, :idToken
60
+ alias_method :id_token=, :idToken=
61
+
62
+ # The newly issued authorization code. Note that an authorization code
63
+ # is issued only when "response_type" contains "code". (String)
64
+ attr_accessor :authorizationCode
65
+ alias_method :authorization_code, :authorizationCode
66
+ alias_method :authorization_code=, :authorizationCode=
67
+
68
+ private
69
+
70
+ # The constructor which takes a hash that represents a JSON response
71
+ # from Authlete's /api/auth/authorization/issue API.
72
+ def initialize(hash = {})
73
+ super(hash)
74
+
75
+ @action = extract_value(hash, :action)
76
+ @responseContent = extract_value(hash, :responseContent)
77
+ @accessToken = extract_value(hash, :accessToken)
78
+ @accessTokenExpiresAt = extract_integer_value(hash, :accessTokenExpiresAt)
79
+ @accessTokenDuration = extract_integer_value(hash, :accessTokenDuration)
80
+ @idToken = extract_value(hash, :idToken)
81
+ @authorizationCode = extract_value(hash, :authorizationCode)
82
+ end
83
+ end
84
+ end
85
+ end
49
86
  end
@@ -1,165 +1,178 @@
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 Model
20
- module Response
21
- # == Authlete::Model::Response::AuthorizationResponse class
22
- #
23
- # This class represents a response from Authlete's /api/auth/authorization API.
24
- class AuthorizationResponse < Authlete::Model::Result
25
- # The flag which indicates whether the end-user authentication
26
- # must satisfy one of the requested ACRs. (BOOLEAN)
27
- attr_accessor :acrEssential
28
- alias_method :acr_essential, :acrEssential
29
- alias_method :acr_essential=, :acrEssential=
30
-
31
- # The list of ACRs (Authentication Context Class References)
32
- # requested by the client application.
33
- # The value come from (1) "acr" claim in "claims" request parameter,
34
- # (2) "acr_values" request parameter or (3) "default_acr_values"
35
- # configuration parameter of the client application.
36
- # (String array)
37
- attr_accessor :acrs
38
-
39
- # The next action that the service implementation should take.
40
- # (String)
41
- attr_accessor :action
42
-
43
- # The list of preferred languages and scripts for claim
44
- # values contained in the ID token. The value comes from
45
- # "claims_locales" request parameter. (String array)
46
- attr_accessor :claimLocales
47
- alias_method :claim_locales, :claimLocales
48
- alias_method :claim_locales=, :claimLocales=
49
-
50
- # The list of claims that the client application requests
51
- # to be embedded in the ID token. The value comes from
52
- # "scope" and "claims" request parameters of
53
- # the original authorization request. (String array)
54
- attr_accessor :claims
55
-
56
- # The information about the client application which has made
57
- # the authorization request. (Client)
58
- attr_accessor :client
59
-
60
- # The display mode which the client application requests
61
- # by "display" request parameter. When the authorization
62
- # request does not contain "display" request parameter,
63
- # this method returns "PAGE" as the default value.
64
- # (String)
65
- attr_accessor :display
66
-
67
- # The value of login hint, which is specified by the client
68
- # application using "login_hint" request parameter.
69
- # (String)
70
- attr_accessor :loginHint
71
- alias_method :login_hint, :loginHint
72
- alias_method :login_hint=, :loginHint=
73
-
74
- # The prompt that the UI displayed to the end-user must satisfy
75
- # at least. The value comes from "prompt" request parameter.
76
- # When the authorization request does not contain "prompt"
77
- # parameter, this method returns "CONSENT CONSENT" as
78
- # the default value. (String)
79
- attr_accessor :lowestPrompt
80
- alias_method :lowest_prompt, :lowestPrompt
81
- alias_method :lowest_prompt=, :lowestPrompt=
82
-
83
- # The maximum authentication age which is the allowable
84
- # elapsed time in seconds since the last time the end-user
85
- # was actively authenticated by the service implementation.
86
- # The value comes from "max_age" request parameter
87
- # or "default_max_age" configuration parameter of
88
- # the client application. 0 may be returned which means
89
- # that the max age constraint does not have to be imposed.
90
- # (Integer)
91
- attr_accessor :maxAge
92
- alias_method :max_age, :maxAge
93
- alias_method :max_age=, :maxAge=
94
-
95
- # The response content which can be used to generate a response
96
- # to the client application. The format of the value varies
97
- # depending on the value of "action". (String)
98
- attr_accessor :responseContent
99
- alias_method :response_content, :responseContent
100
- alias_method :response_content=, :responseContent=
101
-
102
- # The information about the service to which the authorization request
103
- # has been made. (Service)
104
- attr_accessor :service
105
-
106
- # The scopes which the client application requests by "scope"
107
- # request parameter. When the authorization request does
108
- # not contain "scope" request parameter, this method
109
- # returns a list of scopes which are marked as default by the
110
- # service implementation. "null" may be returned if the
111
- # authorization request does not contain valid scopes and none
112
- # of registered scopes is marked as default.
113
- # (Scope array)
114
- attr_accessor :scopes
115
-
116
- # The subject (= end-user's login ID) that the client
117
- # application requests. The value comes from "sub"
118
- # claim in "claims" request parameter. This method
119
- # may return null (probably in most cases).
120
- # (String)
121
- attr_accessor :subject
122
-
123
- # The ticket which has been issued to the service implementation
124
- # from Authlete's /api/auth/authorization API. This ticket is
125
- # needed for /api/auth/authorization/issue API and
126
- # /api/auth/authorization/fail API. (String)
127
- attr_accessor :ticket
128
-
129
- # The list of preferred languages and scripts for the user
130
- # interface. The value comes from "ui_locales" request
131
- # parameter. (String array)
132
- attr_accessor :uiLocales
133
- alias_method :ui_locales, :uiLocales
134
- alias_method :ui_locales=, :uiLocales=
135
-
136
- private
137
-
138
- # The constructor which takes a hash that represents a JSON response
139
- # from Authlete's /api/auth/authorization API.
140
- def initialize(hash = {})
141
- super(hash)
142
-
143
- @acrEssential = extract_value(hash, :acrEssential)
144
- @acrs = extract_value(hash, :acrs)
145
- @action = extract_value(hash, :action)
146
- @claimLocales = extract_value(hash, :claimLocales)
147
- @claims = extract_value(hash, :claims)
148
- @client = Authlete::Model::Client.new(extract_value(hash, :client))
149
- @display = extract_value(hash, :display)
150
- @loginHint = extract_value(hash, :loginHint)
151
- @lowestPrompt = extract_value(hash, :lowestPrompt)
152
- @maxAge = extract_value(hash, :maxAge)
153
- @responseContent = extract_value(hash, :responseContent)
154
- @service = Authlete::Model::Service.new(extract_value(hash, :service))
155
- @scopes = extract_array_value(hash, :scopes) do |element|
156
- Authlete::Model::Scope.parse(element)
157
- end
158
- @subject = extract_value(hash, :subject)
159
- @ticket = extract_value(hash, :ticket)
160
- @uiLocales = extract_value(hash, :uiLocales)
161
- end
162
- end
163
- end
164
- 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
+ module Authlete
19
+ module Model
20
+ module Response
21
+ # == Authlete::Model::Response::AuthorizationResponse class
22
+ #
23
+ # This class represents a response from Authlete's /api/auth/authorization API.
24
+ class AuthorizationResponse < Authlete::Model::Result
25
+ # The flag which indicates whether the end-user authentication
26
+ # must satisfy one of the requested ACRs. (BOOLEAN)
27
+ attr_accessor :acrEssential
28
+ alias_method :acr_essential, :acrEssential
29
+ alias_method :acr_essential=, :acrEssential=
30
+
31
+ # The list of ACRs (Authentication Context Class References)
32
+ # requested by the client application.
33
+ # The value come from (1) "acr" claim in "claims" request parameter,
34
+ # (2) "acr_values" request parameter or (3) "default_acr_values"
35
+ # configuration parameter of the client application.
36
+ # (String array)
37
+ attr_accessor :acrs
38
+
39
+ # The next action that the service implementation should take.
40
+ # (String)
41
+ attr_accessor :action
42
+
43
+ # The list of preferred languages and scripts for claim
44
+ # values contained in the ID token. The value comes from
45
+ # "claims_locales" request parameter. (String array)
46
+ attr_accessor :claimLocales
47
+ alias_method :claim_locales, :claimLocales
48
+ alias_method :claim_locales=, :claimLocales=
49
+
50
+ # The list of claims that the client application requests
51
+ # to be embedded in the ID token. The value comes from
52
+ # "scope" and "claims" request parameters of
53
+ # the original authorization request. (String array)
54
+ attr_accessor :claims
55
+
56
+ # The information about the client application which has made
57
+ # the authorization request. (Client)
58
+ attr_accessor :client
59
+
60
+ # "true" if the value of the client_id request parameter included in
61
+ # the authorization request is the client ID alias. "false" if the
62
+ # value is the original numeric client ID.. (Boolean)
63
+ attr_accessor :clientIdAliasUsed
64
+ alias_method :client_id_alias_used, :clientIdAliasUsed
65
+ alias_method :client_id_alias_used=, :clientIdAliasUsed=
66
+
67
+ # The display mode which the client application requests
68
+ # by "display" request parameter. When the authorization
69
+ # request does not contain "display" request parameter,
70
+ # this method returns "PAGE" as the default value.
71
+ # (String)
72
+ attr_accessor :display
73
+
74
+ # The value of login hint, which is specified by the client
75
+ # application using "login_hint" request parameter.
76
+ # (String)
77
+ attr_accessor :loginHint
78
+ alias_method :login_hint, :loginHint
79
+ alias_method :login_hint=, :loginHint=
80
+
81
+ # The prompt that the UI displayed to the end-user must satisfy
82
+ # at least. The value comes from "prompt" request parameter.
83
+ # When the authorization request does not contain "prompt"
84
+ # parameter, this method returns "CONSENT CONSENT" as
85
+ # the default value. (String)
86
+ attr_accessor :lowestPrompt
87
+ alias_method :lowest_prompt, :lowestPrompt
88
+ alias_method :lowest_prompt=, :lowestPrompt=
89
+
90
+ # The maximum authentication age which is the allowable
91
+ # elapsed time in seconds since the last time the end-user
92
+ # was actively authenticated by the service implementation.
93
+ # The value comes from "max_age" request parameter
94
+ # or "default_max_age" configuration parameter of
95
+ # the client application. 0 may be returned which means
96
+ # that the max age constraint does not have to be imposed.
97
+ # (Integer)
98
+ attr_accessor :maxAge
99
+ alias_method :max_age, :maxAge
100
+ alias_method :max_age=, :maxAge=
101
+
102
+ # The list of values of prompt request parameter. Possible element
103
+ # values are "CONSENT", "LOGIN", "SELECT_ACCOUNT" and "NONE". (String array)
104
+ attr_accessor :prompts
105
+
106
+ # The response content which can be used to generate a response
107
+ # to the client application. The format of the value varies
108
+ # depending on the value of "action". (String)
109
+ attr_accessor :responseContent
110
+ alias_method :response_content, :responseContent
111
+ alias_method :response_content=, :responseContent=
112
+
113
+ # The information about the service to which the authorization request
114
+ # has been made. (Service)
115
+ attr_accessor :service
116
+
117
+ # The scopes which the client application requests by "scope"
118
+ # request parameter. When the authorization request does
119
+ # not contain "scope" request parameter, this method
120
+ # returns a list of scopes which are marked as default by the
121
+ # service implementation. "nil" may be returned if the
122
+ # authorization request does not contain valid scopes and none
123
+ # of registered scopes is marked as default.
124
+ # (Scope array)
125
+ attr_accessor :scopes
126
+
127
+ # The subject (= end-user's login ID) that the client
128
+ # application requests. The value comes from "sub"
129
+ # claim in "claims" request parameter. This method
130
+ # may return "nil" (probably in most cases).
131
+ # (String)
132
+ attr_accessor :subject
133
+
134
+ # The ticket which has been issued to the service implementation
135
+ # from Authlete's /api/auth/authorization API. This ticket is
136
+ # needed for /api/auth/authorization/issue API and
137
+ # /api/auth/authorization/fail API. (String)
138
+ attr_accessor :ticket
139
+
140
+ # The list of preferred languages and scripts for the user
141
+ # interface. The value comes from "ui_locales" request
142
+ # parameter. (String array)
143
+ attr_accessor :uiLocales
144
+ alias_method :ui_locales, :uiLocales
145
+ alias_method :ui_locales=, :uiLocales=
146
+
147
+ private
148
+
149
+ # The constructor which takes a hash that represents a JSON response
150
+ # from Authlete's /api/auth/authorization API.
151
+ def initialize(hash = {})
152
+ super(hash)
153
+
154
+ @acrEssential = extract_value(hash, :acrEssential)
155
+ @acrs = extract_value(hash, :acrs)
156
+ @action = extract_value(hash, :action)
157
+ @claimLocales = extract_value(hash, :claimLocales)
158
+ @claims = extract_value(hash, :claims)
159
+ @client = Authlete::Model::Client.new(extract_value(hash, :client))
160
+ @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)
161
+ @display = extract_value(hash, :display)
162
+ @loginHint = extract_value(hash, :loginHint)
163
+ @lowestPrompt = extract_value(hash, :lowestPrompt)
164
+ @maxAge = extract_integer_value(hash, :maxAge)
165
+ @prompts = extract_value(hash, :prompts)
166
+ @responseContent = extract_value(hash, :responseContent)
167
+ @service = Authlete::Model::Service.new(extract_value(hash, :service))
168
+ @scopes = extract_array_value(hash, :scopes) do |element|
169
+ Authlete::Model::Scope.parse(element)
170
+ end
171
+ @subject = extract_value(hash, :subject)
172
+ @ticket = extract_value(hash, :ticket)
173
+ @uiLocales = extract_value(hash, :uiLocales)
174
+ end
175
+ end
176
+ end
177
+ end
165
178
  end