authlete 1.0.24 → 1.1.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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/Makefile +40 -0
  4. data/Rakefile +5 -0
  5. data/authlete.gemspec +2 -2
  6. data/lib/authlete.rb +28 -9
  7. data/lib/authlete/api.rb +146 -321
  8. data/lib/authlete/authentication-server.rb +2 -2
  9. data/lib/authlete/exception.rb +14 -15
  10. data/lib/authlete/model/base.rb +30 -0
  11. data/lib/authlete/model/client-extension.rb +17 -119
  12. data/lib/authlete/model/client.rb +196 -345
  13. data/lib/authlete/model/hashable.rb +13 -33
  14. data/lib/authlete/model/named-uri.rb +13 -74
  15. data/lib/authlete/model/pair.rb +13 -74
  16. data/lib/authlete/model/param-initializer.rb +45 -0
  17. data/lib/authlete/model/property.rb +15 -85
  18. data/lib/authlete/model/request/authentication-callback-request.rb +63 -55
  19. data/lib/authlete/model/request/authorization-fail-request.rb +14 -75
  20. data/lib/authlete/model/request/authorization-issue-request.rb +38 -119
  21. data/lib/authlete/model/request/authorization-request.rb +8 -73
  22. data/lib/authlete/model/request/backchannel-authentication-complete-request.rb +97 -0
  23. data/lib/authlete/model/request/backchannel-authentication-fail-request.rb +55 -0
  24. data/lib/authlete/model/request/backchannel-authentication-issue-request.rb +37 -0
  25. data/lib/authlete/model/request/backchannel-authentication-request.rb +63 -0
  26. data/lib/authlete/model/request/base.rb +26 -0
  27. data/lib/authlete/model/request/client-authorization-delete-request.rb +7 -93
  28. data/lib/authlete/model/request/client-authorization-get-list-request.rb +17 -89
  29. data/lib/authlete/model/request/client-authorization-update-request.rb +11 -86
  30. data/lib/authlete/model/request/client-registration-request.rb +49 -0
  31. data/lib/authlete/model/request/client-secret-update-request.rb +7 -89
  32. data/lib/authlete/model/request/developer-authentication-callback-request.rb +40 -43
  33. data/lib/authlete/model/request/device-authorization-request.rb +63 -0
  34. data/lib/authlete/model/request/device-complete-request.rb +99 -0
  35. data/lib/authlete/model/request/device-verification-request.rb +40 -0
  36. data/lib/authlete/model/request/granted-scopes-request.rb +8 -74
  37. data/lib/authlete/model/request/introspection-request.rb +24 -83
  38. data/lib/authlete/model/request/pushed-auth-req-request.rb +64 -0
  39. data/lib/authlete/model/request/revocation-request.rb +14 -88
  40. data/lib/authlete/model/request/standard-introspection-request.rb +8 -73
  41. data/lib/authlete/model/request/token-create-request.rb +52 -183
  42. data/lib/authlete/model/request/token-fail-request.rb +12 -74
  43. data/lib/authlete/model/request/token-issue-request.rb +22 -80
  44. data/lib/authlete/model/request/token-request.rb +44 -81
  45. data/lib/authlete/model/request/token-update-request.rb +35 -121
  46. data/lib/authlete/model/request/user-info-issue-request.rb +14 -80
  47. data/lib/authlete/model/request/user-info-request.rb +25 -70
  48. data/lib/authlete/model/response/access-token.rb +96 -0
  49. data/lib/authlete/model/response/authentication-callback-response.rb +24 -19
  50. data/lib/authlete/model/response/authorization-fail-response.rb +13 -15
  51. data/lib/authlete/model/response/authorization-issue-response.rb +29 -32
  52. data/lib/authlete/model/response/authorization-response.rb +97 -123
  53. data/lib/authlete/model/response/authorized-client-list-response.rb +37 -0
  54. data/lib/authlete/model/response/backchannel-authentication-complete-response.rb +143 -0
  55. data/lib/authlete/model/response/backchannel-authentication-fail-response.rb +47 -0
  56. data/lib/authlete/model/response/backchannel-authentication-issue-response.rb +63 -0
  57. data/lib/authlete/model/response/backchannel-authentication-response.rb +160 -0
  58. data/lib/authlete/model/response/client-list-response.rb +58 -0
  59. data/lib/authlete/model/response/client-registration-response.rb +50 -0
  60. data/lib/authlete/model/response/client-secret-refresh-response.rb +12 -12
  61. data/lib/authlete/model/response/client-secret-update-response.rb +12 -12
  62. data/lib/authlete/model/response/developer-authentication-callback-response.rb +24 -19
  63. data/lib/authlete/model/response/device-authorization-response.rb +134 -0
  64. data/lib/authlete/model/response/device-complete-response.rb +39 -0
  65. data/lib/authlete/model/response/device-verification-response.rb +96 -0
  66. data/lib/authlete/model/response/granted-scopes-get-response.rb +27 -19
  67. data/lib/authlete/model/response/introspection-response.rb +64 -58
  68. data/lib/authlete/model/response/pushed-auth-req-response.rb +59 -0
  69. data/lib/authlete/model/response/revocation-response.rb +12 -15
  70. data/lib/authlete/model/response/service-list-response.rb +54 -0
  71. data/lib/authlete/model/response/standard-introspection-response.rb +13 -15
  72. data/lib/authlete/model/response/token-create-response.rb +50 -55
  73. data/lib/authlete/model/response/token-fail-response.rb +14 -17
  74. data/lib/authlete/model/response/token-issue-response.rb +49 -62
  75. data/lib/authlete/model/response/token-list-response.rb +64 -0
  76. data/lib/authlete/model/response/token-response.rb +59 -79
  77. data/lib/authlete/model/response/token-update-response.rb +28 -23
  78. data/lib/authlete/model/response/user-info-issue-response.rb +16 -16
  79. data/lib/authlete/model/response/user-info-response.rb +48 -42
  80. data/lib/authlete/model/result.rb +14 -13
  81. data/lib/authlete/model/scope.rb +29 -119
  82. data/lib/authlete/model/service-owner.rb +32 -116
  83. data/lib/authlete/model/service.rb +464 -685
  84. data/lib/authlete/model/sns-credentials.rb +18 -91
  85. data/lib/authlete/model/tagged-value.rb +14 -69
  86. data/lib/authlete/utility.rb +3 -32
  87. data/lib/authlete/version.rb +3 -3
  88. data/test/authlete/model/request/test_authentication-callback-request.rb +100 -0
  89. data/test/authlete/model/request/test_authorization-fail-request.rb +67 -0
  90. data/test/authlete/model/request/test_authorization-issue-request.rb +94 -0
  91. data/test/authlete/model/request/test_authorization-request.rb +57 -0
  92. data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +102 -0
  93. data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +71 -0
  94. data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +57 -0
  95. data/test/authlete/model/request/test_backchannel-authentication-request.rb +75 -0
  96. data/test/authlete/model/request/test_client-authorization-delete-request.rb +57 -0
  97. data/test/authlete/model/request/test_client-authorization-get-list-request.rb +71 -0
  98. data/test/authlete/model/request/test_client-authorization-update-request.rb +63 -0
  99. data/test/authlete/model/request/test_client-registration-request.rb +68 -0
  100. data/test/authlete/model/request/test_device-authorization-request.rb +75 -0
  101. data/test/authlete/model/request/test_device-complete-request.rb +102 -0
  102. data/test/authlete/model/request/test_device-verification-request.rb +57 -0
  103. data/test/authlete/model/request/test_granted-scopes-request.rb +57 -0
  104. data/test/authlete/model/request/test_introspection-request.rb +79 -0
  105. data/test/authlete/model/request/test_pushed-auth-req-request.rb +75 -0
  106. data/test/authlete/model/request/test_revocation-request.rb +67 -0
  107. data/test/authlete/model/request/test_standard-introspection-request.rb +57 -0
  108. data/test/authlete/model/request/test_token-create-request.rb +110 -0
  109. data/test/authlete/model/request/test_token-fail-request.rb +63 -0
  110. data/test/authlete/model/request/test_token-issue-request.rb +70 -0
  111. data/test/authlete/model/request/test_token-request.rb +94 -0
  112. data/test/authlete/model/request/test_token-update-request.rb +82 -0
  113. data/test/authlete/model/request/test_user-info-issue-request.rb +67 -0
  114. data/test/authlete/model/request/test_user-info-request.rb +75 -0
  115. data/test/authlete/model/response/test_access-token.rb +101 -0
  116. data/test/authlete/model/response/test_authorization-fail-response.rb +68 -0
  117. data/test/authlete/model/response/test_authorization-issue-response.rb +92 -0
  118. data/test/authlete/model/response/test_authorization-response.rb +145 -0
  119. data/test/authlete/model/response/test_authorized-client-list-response.rb +83 -0
  120. data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +132 -0
  121. data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +68 -0
  122. data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +80 -0
  123. data/test/authlete/model/response/test_backchannel-authentication-response.rb +156 -0
  124. data/test/authlete/model/response/test_client-list-response.rb +79 -0
  125. data/test/authlete/model/response/test_client-secret-refresh-response.rb +68 -0
  126. data/test/authlete/model/response/test_client-secret-update-response.rb +68 -0
  127. data/test/authlete/model/response/test_device-authorization-response.rb +140 -0
  128. data/test/authlete/model/response/test_device-complete-response.rb +64 -0
  129. data/test/authlete/model/response/test_device-verification-response.rb +112 -0
  130. data/test/authlete/model/response/test_granted-scopes-get-response.rb +84 -0
  131. data/test/authlete/model/response/test_introspection-response.rb +127 -0
  132. data/test/authlete/model/response/test_pushed-auth-req-response.rb +76 -0
  133. data/test/authlete/model/response/test_revocation-response.rb +68 -0
  134. data/test/authlete/model/response/test_service-list-response.rb +72 -0
  135. data/test/authlete/model/response/test_standard-introspection-response.rb +68 -0
  136. data/test/authlete/model/response/test_token-create-response.rb +107 -0
  137. data/test/authlete/model/response/test_token-fail-response.rb +68 -0
  138. data/test/authlete/model/response/test_token-issue-response.rb +127 -0
  139. data/test/authlete/model/response/test_token-list-response.rb +84 -0
  140. data/test/authlete/model/response/test_token-response.rb +147 -0
  141. data/test/authlete/model/response/test_token-update-response.rb +87 -0
  142. data/test/authlete/model/response/test_user-info-issue-response.rb +68 -0
  143. data/test/authlete/model/response/test_user-info-response.rb +107 -0
  144. data/test/authlete/model/test_client-extension.rb +95 -0
  145. data/test/authlete/model/test_client.rb +461 -0
  146. data/test/authlete/model/test_named-uri.rb +85 -0
  147. data/test/authlete/model/test_pair.rb +85 -0
  148. data/test/authlete/model/test_property.rb +90 -0
  149. data/test/authlete/model/test_result.rb +68 -0
  150. data/test/authlete/model/test_scope.rb +106 -0
  151. data/test/authlete/model/test_service-owner.rb +80 -0
  152. data/test/authlete/model/test_service.rb +614 -0
  153. data/test/authlete/model/test_sns-credentials.rb +88 -0
  154. data/test/authlete/model/test_tagged-value.rb +83 -0
  155. data/test/authlete/test_exception.rb +70 -0
  156. metadata +169 -9
  157. data/lib/authlete/model/client-list.rb +0 -129
  158. data/lib/authlete/model/response/client-authorization-get-list-response.rb +0 -60
  159. data/lib/authlete/model/response/service-creatable-response.rb +0 -51
  160. data/lib/authlete/model/service-list.rb +0 -128
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 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.
@@ -18,69 +18,66 @@
18
18
  module Authlete
19
19
  module Model
20
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
21
  class AuthorizationIssueResponse < Authlete::Model::Result
25
- # The next action that the service implementation should take.
26
- # (String)
22
+
27
23
  attr_accessor :action
28
24
 
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
25
  attr_accessor :responseContent
33
26
  alias_method :response_content, :responseContent
34
27
  alias_method :response_content=, :responseContent=
35
28
 
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
29
  attr_accessor :accessToken
40
30
  alias_method :access_token, :accessToken
41
31
  alias_method :access_token=, :accessToken=
42
32
 
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
33
  attr_accessor :accessTokenExpiresAt
47
34
  alias_method :access_token_expires_at, :accessTokenExpiresAt
48
35
  alias_method :access_token_expires_at=, :accessTokenExpiresAt=
49
36
 
50
- # The duration of the newly issued access token in seconds. (Integer)
51
37
  attr_accessor :accessTokenDuration
52
38
  alias_method :access_token_duration, :accessTokenDuration
53
39
  alias_method :access_token_duration=, :accessTokenDuration=
54
40
 
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
41
  attr_accessor :idToken
59
42
  alias_method :id_token, :idToken
60
43
  alias_method :id_token=, :idToken=
61
44
 
62
- # The newly issued authorization code. Note that an authorization code
63
- # is issued only when "response_type" contains "code". (String)
64
45
  attr_accessor :authorizationCode
65
46
  alias_method :authorization_code, :authorizationCode
66
47
  alias_method :authorization_code=, :authorizationCode=
67
48
 
49
+ attr_accessor :jwtAccessToken
50
+ alias_method :jwt_access_token, :jwtAccessToken
51
+ alias_method :jwt_access_token=, :jwtAccessToken=
52
+
68
53
  private
69
54
 
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 = {})
55
+ def defaults
56
+ super.merge(
57
+ action: nil,
58
+ responseContent: nil,
59
+ accessToken: nil,
60
+ accessTokenExpiresAt: 0,
61
+ accessTokenDuration: 0,
62
+ idToken: nil,
63
+ authorizationCode: nil,
64
+ jwtAccessToken: nil
65
+ )
66
+ end
67
+
68
+ def set_params(hash = {})
73
69
  super(hash)
74
70
 
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)
71
+ @action = hash[:action]
72
+ @responseContent = hash[:responseContent]
73
+ @accessToken = hash[:accessToken]
74
+ @accessTokenExpiresAt = hash[:accessTokenExpiresAt]
75
+ @accessTokenDuration = hash[:accessTokenDuration]
76
+ @idToken = hash[:idToken]
77
+ @authorizationCode = hash[:authorizationCode]
78
+ @jwtAccessToken = hash[:jwtAccessToken]
82
79
  end
83
80
  end
84
81
  end
85
82
  end
86
- end
83
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 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.
@@ -18,161 +18,135 @@
18
18
  module Authlete
19
19
  module Model
20
20
  module Response
21
- # == Authlete::Model::Response::AuthorizationResponse class
22
- #
23
- # This class represents a response from Authlete's /api/auth/authorization API.
24
21
  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=
22
+ include Authlete::Utility
30
23
 
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
24
  attr_accessor :action
42
25
 
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
26
+ attr_accessor :service
55
27
 
56
- # The information about the client application which has made
57
- # the authorization request. (Client)
58
28
  attr_accessor :client
59
29
 
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)
30
+ attr_accessor :display
31
+
32
+ attr_accessor :maxAge
33
+ alias_method :max_age, :maxAge
34
+ alias_method :max_age=, :maxAge=
35
+
36
+ attr_accessor :scopes
37
+
38
+ attr_accessor :uiLocales
39
+ alias_method :ui_locales, :uiLocales
40
+ alias_method :ui_locales=, :uiLocales=
41
+
42
+ attr_accessor :claimsLocales
43
+ alias_method :claims_locales, :claimsLocales
44
+ alias_method :claims_locales=, :claimsLocales=
45
+
46
+ attr_accessor :claims
47
+
48
+ attr_accessor :acrEssential
49
+ alias_method :acr_essential, :acrEssential
50
+ alias_method :acr_essential=, :acrEssential=
51
+
63
52
  attr_accessor :clientIdAliasUsed
64
53
  alias_method :client_id_alias_used, :clientIdAliasUsed
65
54
  alias_method :client_id_alias_used=, :clientIdAliasUsed=
66
55
 
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
56
+ attr_accessor :acrs
57
+
58
+ attr_accessor :subject
73
59
 
74
- # The value of login hint, which is specified by the client
75
- # application using "login_hint" request parameter.
76
- # (String)
77
60
  attr_accessor :loginHint
78
61
  alias_method :login_hint, :loginHint
79
62
  alias_method :login_hint=, :loginHint=
80
63
 
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
64
  attr_accessor :lowestPrompt
87
65
  alias_method :lowest_prompt, :lowestPrompt
88
66
  alias_method :lowest_prompt=, :lowestPrompt=
89
67
 
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
68
  attr_accessor :prompts
105
69
 
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=
70
+ attr_accessor :requestObjectPayload
71
+ alias_method :request_object_payload, :requestObjectPayload
72
+ alias_method :request_object_payload=, :requestObjectPayload=
112
73
 
113
- # The information about the service to which the authorization request
114
- # has been made. (Service)
115
- attr_accessor :service
74
+ attr_accessor :idTokenClaims
75
+ alias_method :id_token_claims, :idTokenClaims
76
+ alias_method :id_token_claims=, :idTokenClaims=
116
77
 
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
78
+ attr_accessor :userInfoClaims
79
+ alias_method :user_info_claims, :userInfoClaims
80
+ alias_method :user_info_claims=, :userInfoClaims=
126
81
 
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
82
+ attr_accessor :resources
133
83
 
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
84
+ attr_accessor :purpose
139
85
 
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=
86
+ attr_accessor :responseContent
87
+ alias_method :response_content, :responseContent
88
+ alias_method :response_content=, :responseContent=
89
+
90
+ attr_accessor :ticket
146
91
 
147
92
  private
148
93
 
149
- # The constructor which takes a hash that represents a JSON response
150
- # from Authlete's /api/auth/authorization API.
151
- def initialize(hash = {})
94
+ def defaults
95
+ super.merge(
96
+ action: nil,
97
+ service: nil,
98
+ client: nil,
99
+ display: nil,
100
+ maxAge: 0,
101
+ scopes: nil,
102
+ uiLocales: nil,
103
+ claimsLocales: nil,
104
+ claims: nil,
105
+ acrEssential: false,
106
+ clientIdAliasUsed: false,
107
+ acrs: nil,
108
+ subject: nil,
109
+ loginHint: nil,
110
+ lowestPrompt: nil,
111
+ prompts: nil,
112
+ requestObjectPayload: nil,
113
+ idTokenClaims: nil,
114
+ userInfoClaims: nil,
115
+ resources: nil,
116
+ purpose: nil,
117
+ responseContent: nil,
118
+ ticket: nil
119
+ )
120
+ end
121
+
122
+ def set_params(hash)
152
123
  super(hash)
153
124
 
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)
125
+ @action = hash[:action]
126
+ @service = Authlete::Model::Service.new(hash[:service])
127
+ @client = Authlete::Model::Client.new(hash[:client])
128
+ @display = hash[:display]
129
+ @maxAge = hash[:maxAge]
130
+ @scopes = get_parsed_array(hash[:scopes]) { |e| Authlete::Model::Scope.parse(e) }
131
+ @uiLocales = hash[:uiLocales]
132
+ @claimsLocales = hash[:claimsLocales]
133
+ @claims = hash[:claims]
134
+ @acrEssential = hash[:acrEssential]
135
+ @clientIdAliasUsed = hash[:clientIdAliasUsed]
136
+ @acrs = hash[:acrs]
137
+ @subject = hash[:subject]
138
+ @loginHint = hash[:loginHint]
139
+ @lowestPrompt = hash[:lowestPrompt]
140
+ @prompts = hash[:prompts]
141
+ @requestObjectPayload = hash[:requestObjectPayload]
142
+ @idTokenClaims = hash[:idTokenClaims]
143
+ @userInfoClaims = hash[:userInfoClaims]
144
+ @resources = hash[:resources]
145
+ @purpose = hash[:purpose]
146
+ @responseContent = hash[:responseContent]
147
+ @ticket = hash[:ticket]
174
148
  end
175
149
  end
176
150
  end
177
151
  end
178
- end
152
+ end
@@ -0,0 +1,37 @@
1
+ # :nodoc:
2
+ #
3
+ # Copyright (C) 2014-2020 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
+ class AuthorizedClientListResponse < Authlete::Model::Response::ClientListResponse
22
+
23
+ attr_accessor :subject
24
+
25
+ def defaults
26
+ super.merge(subject: nil)
27
+ end
28
+
29
+ def set_params(hash)
30
+ super(hash)
31
+
32
+ @subject = hash[:subject]
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,143 @@
1
+ # :nodoc:
2
+ #
3
+ # Copyright (C) 2014-2020 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
+ class BackchannelAuthenticationCompleteResponse < Authlete::Model::Result
22
+
23
+ attr_accessor :action
24
+
25
+ attr_accessor :responseContent
26
+ alias_method :response_content, :responseContent
27
+ alias_method :response_content=, :responseContent=
28
+
29
+ attr_accessor :clientId
30
+ alias_method :client_id, :clientId
31
+ alias_method :client_id=, :clientId=
32
+
33
+ attr_accessor :clientIdAlias
34
+ alias_method :client_id_alias, :clientIdAlias
35
+ alias_method :client_id_alias=, :clientIdAlias=
36
+
37
+ attr_accessor :clientIdAliasUsed
38
+ alias_method :client_id_alias_used, :clientIdAliasUsed
39
+ alias_method :client_id_alias_used=, :clientIdAliasUsed=
40
+
41
+ attr_accessor :clientName
42
+ alias_method :client_name, :clientName
43
+ alias_method :client_name=, :clientName=
44
+
45
+ attr_accessor :deliveryMethod
46
+ alias_method :delivery_method, :deliveryMethod
47
+ alias_method :delivery_method=, :deliveryMethod=
48
+
49
+ attr_accessor :clientNotificationEndpoint
50
+ alias_method :client_notification_endpoint, :clientNotificationEndpoint
51
+ alias_method :client_notification_endpoint=, :clientNotificationEndpoint=
52
+
53
+ attr_accessor :clientNotificationToken
54
+ alias_method :client_notification_token, :clientNotificationToken
55
+ alias_method :client_notification_token=, :clientNotificationToken=
56
+
57
+ attr_accessor :authReqId
58
+ alias_method :auth_req_id, :authReqId
59
+ alias_method :auth_req_id=, :authReqId=
60
+
61
+ attr_accessor :accessToken
62
+ alias_method :access_token, :accessToken
63
+ alias_method :access_token=, :accessToken=
64
+
65
+ attr_accessor :refreshToken
66
+ alias_method :refresh_token, :refreshToken
67
+ alias_method :refresh_token=, :refreshToken=
68
+
69
+ attr_accessor :idToken
70
+ alias_method :id_token, :idToken
71
+ alias_method :id_token=, :idToken=
72
+
73
+ attr_accessor :accessTokenDuration
74
+ alias_method :access_token_duration, :accessTokenDuration
75
+ alias_method :access_token_duration=, :accessTokenDuration=
76
+
77
+ attr_accessor :refreshTokenDuration
78
+ alias_method :refresh_token_duration, :refreshTokenDuration
79
+ alias_method :refresh_token_duration=, :refreshTokenDuration=
80
+
81
+ attr_accessor :idTokenDuration
82
+ alias_method :id_token_duration, :idTokenDuration
83
+ alias_method :id_token_duration=, :idTokenDuration=
84
+
85
+ attr_accessor :jwtAccessToken
86
+ alias_method :jwt_access_token, :jwtAccessToken
87
+ alias_method :jwt_access_token=, :jwtAccessToken=
88
+
89
+ attr_accessor :resources
90
+
91
+ private
92
+
93
+ def defaults
94
+ super.merge(
95
+ action: nil,
96
+ responseContent: nil,
97
+ clientId: 0,
98
+ clientIdAlias: nil,
99
+ clientIdAliasUsed: false,
100
+ clientName: nil,
101
+ clientAuthMethod: nil,
102
+ deliveryMethod: nil,
103
+ clientNotificationToken: nil,
104
+ clientNotificationEndpoint: nil,
105
+ authReqId: nil,
106
+ accessToken: nil,
107
+ refreshToken: nil,
108
+ idToken: nil,
109
+ accessTokenDuration: 0,
110
+ refreshTokenDuration: 0,
111
+ idTokenDuration: 0,
112
+ jwtAccessToken: nil,
113
+ resources: nil
114
+ )
115
+ end
116
+
117
+ def set_params(hash)
118
+ super(hash)
119
+
120
+ @action = hash[:action]
121
+ @responseContent = hash[:responseContent]
122
+ @clientId = hash[:clientId]
123
+ @clientIdAlias = hash[:clientIdAlias]
124
+ @clientIdAliasUsed = hash[:clientIdAliasUsed]
125
+ @clientName = hash[:clientName]
126
+ @clientAuthMethod = hash[:clientAuthMethod]
127
+ @deliveryMethod = hash[:deliveryMethod]
128
+ @clientNotificationToken = hash[:clientNotificationToken]
129
+ @clientNotificationEndpoint = hash[:clientNotificationEndpoint]
130
+ @authReqId = hash[:authReqId]
131
+ @accessToken = hash[:accessToken]
132
+ @refreshToken = hash[:refreshToken]
133
+ @idToken = hash[:idToken]
134
+ @accessTokenDuration = hash[:accessTokenDuration]
135
+ @refreshTokenDuration = hash[:refreshTokenDuration]
136
+ @idTokenDuration = hash[:idTokenDuration]
137
+ @jwtAccessToken = hash[:jwtAccessToken]
138
+ @resources = hash[:resources]
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end