authlete 1.0.23 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Makefile +40 -0
- data/Rakefile +5 -0
- data/authlete.gemspec +2 -2
- data/lib/authlete.rb +28 -9
- data/lib/authlete/api.rb +153 -322
- data/lib/authlete/authentication-server.rb +2 -2
- data/lib/authlete/exception.rb +14 -15
- data/lib/authlete/model/base.rb +30 -0
- data/lib/authlete/model/client-extension.rb +17 -119
- data/lib/authlete/model/client.rb +205 -349
- data/lib/authlete/model/hashable.rb +13 -33
- data/lib/authlete/model/named-uri.rb +13 -74
- data/lib/authlete/model/pair.rb +13 -74
- data/lib/authlete/model/param-initializer.rb +45 -0
- data/lib/authlete/model/property.rb +15 -85
- data/lib/authlete/model/request/authentication-callback-request.rb +63 -55
- data/lib/authlete/model/request/authorization-fail-request.rb +14 -75
- data/lib/authlete/model/request/authorization-issue-request.rb +38 -119
- data/lib/authlete/model/request/authorization-request.rb +8 -73
- data/lib/authlete/model/request/backchannel-authentication-complete-request.rb +97 -0
- data/lib/authlete/model/request/backchannel-authentication-fail-request.rb +55 -0
- data/lib/authlete/model/request/backchannel-authentication-issue-request.rb +37 -0
- data/lib/authlete/model/request/backchannel-authentication-request.rb +63 -0
- data/lib/authlete/model/request/base.rb +26 -0
- data/lib/authlete/model/request/client-authorization-delete-request.rb +7 -93
- data/lib/authlete/model/request/client-authorization-get-list-request.rb +17 -89
- data/lib/authlete/model/request/client-authorization-update-request.rb +11 -86
- data/lib/authlete/model/request/client-registration-request.rb +49 -0
- data/lib/authlete/model/request/client-secret-update-request.rb +7 -89
- data/lib/authlete/model/request/developer-authentication-callback-request.rb +40 -43
- data/lib/authlete/model/request/device-authorization-request.rb +63 -0
- data/lib/authlete/model/request/device-complete-request.rb +99 -0
- data/lib/authlete/model/request/device-verification-request.rb +40 -0
- data/lib/authlete/model/request/granted-scopes-request.rb +8 -74
- data/lib/authlete/model/request/introspection-request.rb +24 -83
- data/lib/authlete/model/request/pushed-auth-req-request.rb +64 -0
- data/lib/authlete/model/request/revocation-request.rb +14 -88
- data/lib/authlete/model/request/standard-introspection-request.rb +8 -73
- data/lib/authlete/model/request/token-create-request.rb +52 -183
- data/lib/authlete/model/request/token-fail-request.rb +12 -74
- data/lib/authlete/model/request/token-issue-request.rb +22 -80
- data/lib/authlete/model/request/token-request.rb +44 -81
- data/lib/authlete/model/request/token-update-request.rb +35 -121
- data/lib/authlete/model/request/user-info-issue-request.rb +14 -80
- data/lib/authlete/model/request/user-info-request.rb +25 -70
- data/lib/authlete/model/response/access-token.rb +96 -0
- data/lib/authlete/model/response/authentication-callback-response.rb +24 -19
- data/lib/authlete/model/response/authorization-fail-response.rb +13 -15
- data/lib/authlete/model/response/authorization-issue-response.rb +29 -32
- data/lib/authlete/model/response/authorization-response.rb +97 -123
- data/lib/authlete/model/response/authorized-client-list-response.rb +37 -0
- data/lib/authlete/model/response/backchannel-authentication-complete-response.rb +143 -0
- data/lib/authlete/model/response/backchannel-authentication-fail-response.rb +47 -0
- data/lib/authlete/model/response/backchannel-authentication-issue-response.rb +63 -0
- data/lib/authlete/model/response/backchannel-authentication-response.rb +160 -0
- data/lib/authlete/model/response/client-list-response.rb +58 -0
- data/lib/authlete/model/response/client-registration-response.rb +50 -0
- data/lib/authlete/model/response/client-secret-refresh-response.rb +12 -12
- data/lib/authlete/model/response/client-secret-update-response.rb +12 -12
- data/lib/authlete/model/response/developer-authentication-callback-response.rb +24 -19
- data/lib/authlete/model/response/device-authorization-response.rb +134 -0
- data/lib/authlete/model/response/device-complete-response.rb +39 -0
- data/lib/authlete/model/response/device-verification-response.rb +96 -0
- data/lib/authlete/model/response/granted-scopes-get-response.rb +27 -19
- data/lib/authlete/model/response/introspection-response.rb +64 -58
- data/lib/authlete/model/response/pushed-auth-req-response.rb +59 -0
- data/lib/authlete/model/response/revocation-response.rb +12 -15
- data/lib/authlete/model/response/service-list-response.rb +54 -0
- data/lib/authlete/model/response/standard-introspection-response.rb +13 -15
- data/lib/authlete/model/response/token-create-response.rb +50 -55
- data/lib/authlete/model/response/token-fail-response.rb +14 -17
- data/lib/authlete/model/response/token-issue-response.rb +49 -62
- data/lib/authlete/model/response/token-list-response.rb +64 -0
- data/lib/authlete/model/response/token-response.rb +59 -79
- data/lib/authlete/model/response/token-update-response.rb +28 -23
- data/lib/authlete/model/response/user-info-issue-response.rb +16 -16
- data/lib/authlete/model/response/user-info-response.rb +48 -42
- data/lib/authlete/model/result.rb +14 -13
- data/lib/authlete/model/scope.rb +29 -119
- data/lib/authlete/model/service-owner.rb +32 -116
- data/lib/authlete/model/service.rb +488 -677
- data/lib/authlete/model/sns-credentials.rb +18 -91
- data/lib/authlete/model/tagged-value.rb +14 -69
- data/lib/authlete/utility.rb +3 -32
- data/lib/authlete/version.rb +3 -3
- data/test/authlete/model/request/test_authentication-callback-request.rb +100 -0
- data/test/authlete/model/request/test_authorization-fail-request.rb +67 -0
- data/test/authlete/model/request/test_authorization-issue-request.rb +94 -0
- data/test/authlete/model/request/test_authorization-request.rb +57 -0
- data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +102 -0
- data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +71 -0
- data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +57 -0
- data/test/authlete/model/request/test_backchannel-authentication-request.rb +75 -0
- data/test/authlete/model/request/test_client-authorization-delete-request.rb +57 -0
- data/test/authlete/model/request/test_client-authorization-get-list-request.rb +71 -0
- data/test/authlete/model/request/test_client-authorization-update-request.rb +63 -0
- data/test/authlete/model/request/test_client-registration-request.rb +68 -0
- data/test/authlete/model/request/test_device-authorization-request.rb +75 -0
- data/test/authlete/model/request/test_device-complete-request.rb +102 -0
- data/test/authlete/model/request/test_device-verification-request.rb +57 -0
- data/test/authlete/model/request/test_granted-scopes-request.rb +57 -0
- data/test/authlete/model/request/test_introspection-request.rb +79 -0
- data/test/authlete/model/request/test_pushed-auth-req-request.rb +75 -0
- data/test/authlete/model/request/test_revocation-request.rb +67 -0
- data/test/authlete/model/request/test_standard-introspection-request.rb +57 -0
- data/test/authlete/model/request/test_token-create-request.rb +110 -0
- data/test/authlete/model/request/test_token-fail-request.rb +63 -0
- data/test/authlete/model/request/test_token-issue-request.rb +70 -0
- data/test/authlete/model/request/test_token-request.rb +94 -0
- data/test/authlete/model/request/test_token-update-request.rb +82 -0
- data/test/authlete/model/request/test_user-info-issue-request.rb +67 -0
- data/test/authlete/model/request/test_user-info-request.rb +75 -0
- data/test/authlete/model/response/test_access-token.rb +101 -0
- data/test/authlete/model/response/test_authorization-fail-response.rb +68 -0
- data/test/authlete/model/response/test_authorization-issue-response.rb +92 -0
- data/test/authlete/model/response/test_authorization-response.rb +145 -0
- data/test/authlete/model/response/test_authorized-client-list-response.rb +83 -0
- data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +132 -0
- data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +68 -0
- data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +80 -0
- data/test/authlete/model/response/test_backchannel-authentication-response.rb +156 -0
- data/test/authlete/model/response/test_client-list-response.rb +79 -0
- data/test/authlete/model/response/test_client-secret-refresh-response.rb +68 -0
- data/test/authlete/model/response/test_client-secret-update-response.rb +68 -0
- data/test/authlete/model/response/test_device-authorization-response.rb +140 -0
- data/test/authlete/model/response/test_device-complete-response.rb +64 -0
- data/test/authlete/model/response/test_device-verification-response.rb +112 -0
- data/test/authlete/model/response/test_granted-scopes-get-response.rb +84 -0
- data/test/authlete/model/response/test_introspection-response.rb +127 -0
- data/test/authlete/model/response/test_pushed-auth-req-response.rb +76 -0
- data/test/authlete/model/response/test_revocation-response.rb +68 -0
- data/test/authlete/model/response/test_service-list-response.rb +72 -0
- data/test/authlete/model/response/test_standard-introspection-response.rb +68 -0
- data/test/authlete/model/response/test_token-create-response.rb +107 -0
- data/test/authlete/model/response/test_token-fail-response.rb +68 -0
- data/test/authlete/model/response/test_token-issue-response.rb +127 -0
- data/test/authlete/model/response/test_token-list-response.rb +84 -0
- data/test/authlete/model/response/test_token-response.rb +147 -0
- data/test/authlete/model/response/test_token-update-response.rb +87 -0
- data/test/authlete/model/response/test_user-info-issue-response.rb +68 -0
- data/test/authlete/model/response/test_user-info-response.rb +107 -0
- data/test/authlete/model/test_client-extension.rb +93 -0
- data/test/authlete/model/test_client.rb +469 -0
- data/test/authlete/model/test_named-uri.rb +83 -0
- data/test/authlete/model/test_pair.rb +83 -0
- data/test/authlete/model/test_property.rb +88 -0
- data/test/authlete/model/test_result.rb +68 -0
- data/test/authlete/model/test_scope.rb +104 -0
- data/test/authlete/model/test_service-owner.rb +80 -0
- data/test/authlete/model/test_service.rb +630 -0
- data/test/authlete/model/test_sns-credentials.rb +88 -0
- data/test/authlete/model/test_tagged-value.rb +83 -0
- data/test/authlete/test_exception.rb +70 -0
- metadata +169 -9
- data/lib/authlete/model/client-list.rb +0 -129
- data/lib/authlete/model/response/client-authorization-get-list-response.rb +0 -60
- data/lib/authlete/model/response/service-creatable-response.rb +0 -51
- data/lib/authlete/model/service-list.rb +0 -128
@@ -0,0 +1,59 @@
|
|
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 PushedAuthReqResponse < 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 :clientAuthMethod
|
30
|
+
alias_method :client_auth_method, :clientAuthMethod
|
31
|
+
alias_method :client_auth_method=, :clientAuthMethod=
|
32
|
+
|
33
|
+
attr_accessor :requestUri
|
34
|
+
alias_method :request_uri, :requestUri
|
35
|
+
alias_method :request_uri=, :requestUri=
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def defaults
|
40
|
+
super.merge(
|
41
|
+
action: nil,
|
42
|
+
responseContent: nil,
|
43
|
+
clientAuthMethod: nil,
|
44
|
+
requestUri: nil
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def set_params(hash)
|
49
|
+
super(hash)
|
50
|
+
|
51
|
+
@action = hash[:action]
|
52
|
+
@responseContent = hash[:responseContent]
|
53
|
+
@clientAuthMethod = hash[:clientAuthMethod]
|
54
|
+
@requestUri = hash[:requestUri]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
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,32 +18,29 @@
|
|
18
18
|
module Authlete
|
19
19
|
module Model
|
20
20
|
module Response
|
21
|
-
# == Authlete::Model::Response::RevicationResponse class
|
22
|
-
#
|
23
|
-
# This class represents a response from Authlete's /api/auth/revocation API.
|
24
21
|
class RevocationResponse < Authlete::Model::Result
|
25
|
-
# The next action that the service implementation should take.
|
26
|
-
# (String)
|
27
22
|
attr_accessor :action
|
28
23
|
|
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
24
|
attr_accessor :responseContent
|
33
25
|
alias_method :response_content, :responseContent
|
34
26
|
alias_method :response_content=, :responseContent=
|
35
27
|
|
36
28
|
private
|
37
29
|
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
def defaults
|
31
|
+
super.merge(
|
32
|
+
action: nil,
|
33
|
+
responseContent: nil
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def set_params(hash)
|
41
38
|
super(hash)
|
42
39
|
|
43
|
-
@action =
|
44
|
-
@responseContent =
|
40
|
+
@action = hash[:action]
|
41
|
+
@responseContent = hash[:responseContent]
|
45
42
|
end
|
46
43
|
end
|
47
44
|
end
|
48
45
|
end
|
49
|
-
end
|
46
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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 ServiceListResponse < Authlete::Model::Base
|
22
|
+
include Authlete::Utility
|
23
|
+
|
24
|
+
attr_accessor :start
|
25
|
+
|
26
|
+
attr_accessor :end
|
27
|
+
|
28
|
+
attr_accessor :totalCount
|
29
|
+
alias_method :total_count, :totalCount
|
30
|
+
alias_method :total_count=, :totalCount=
|
31
|
+
|
32
|
+
attr_accessor :services
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def defaults
|
37
|
+
{
|
38
|
+
start: 0,
|
39
|
+
end: 0,
|
40
|
+
totalCount: 0,
|
41
|
+
services: nil
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_params(hash)
|
46
|
+
@start = hash[:start]
|
47
|
+
@end = hash[:end]
|
48
|
+
@totalCount = hash[:totalCount]
|
49
|
+
@services = get_parsed_array(hash[:services]) { |e| Authlete::Model::Service.parse(e) }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
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,32 +18,30 @@
|
|
18
18
|
module Authlete
|
19
19
|
module Model
|
20
20
|
module Response
|
21
|
-
# == Authlete::Model::Response::StandardIntrospectionResponse class
|
22
|
-
#
|
23
|
-
# This class represents a response from Authlete's /api/auth/introspection/standard API.
|
24
21
|
class StandardIntrospectionResponse < Authlete::Model::Result
|
25
|
-
|
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
29
|
private
|
37
30
|
|
38
|
-
|
39
|
-
|
40
|
-
|
31
|
+
def defaults
|
32
|
+
super.merge(
|
33
|
+
action: nil,
|
34
|
+
responseContent: nil
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def set_params(hash)
|
41
39
|
super(hash)
|
42
40
|
|
43
|
-
@action =
|
44
|
-
@responseContent =
|
41
|
+
@action = hash[:action]
|
42
|
+
@responseContent = hash[:responseContent]
|
45
43
|
end
|
46
44
|
end
|
47
45
|
end
|
48
46
|
end
|
49
|
-
end
|
47
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
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,83 +18,78 @@
|
|
18
18
|
module Authlete
|
19
19
|
module Model
|
20
20
|
module Response
|
21
|
-
# == Authlete::Model::Response::TokenCreateResponse class
|
22
|
-
#
|
23
|
-
# A class that represents a response from Authlete's
|
24
|
-
# /api/auth/token/create API.
|
25
21
|
class TokenCreateResponse < Authlete::Model::Result
|
26
|
-
|
27
|
-
# (String)
|
22
|
+
|
28
23
|
attr_accessor :action
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
alias_method :
|
33
|
-
alias_method :access_token=, :accessToken=
|
25
|
+
attr_accessor :grantType
|
26
|
+
alias_method :grant_type, :grantType
|
27
|
+
alias_method :grant_type=, :grantType=
|
34
28
|
|
35
|
-
# The ID of the client application which is associated with the access
|
36
|
-
# token. (Integer)
|
37
29
|
attr_accessor :clientId
|
38
30
|
alias_method :client_id, :clientId
|
39
31
|
alias_method :client_id=, :clientId=
|
40
32
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
33
|
+
attr_accessor :subject
|
34
|
+
|
35
|
+
attr_accessor :scopes
|
36
|
+
|
37
|
+
attr_accessor :accessToken
|
38
|
+
alias_method :access_token, :accessToken
|
39
|
+
alias_method :access_token=, :accessToken=
|
40
|
+
|
41
|
+
attr_accessor :tokenType
|
42
|
+
alias_method :token_type, :tokenType
|
43
|
+
alias_method :token_type=, :tokenType=
|
45
44
|
|
46
|
-
|
47
|
-
attr_accessor :expires_in
|
45
|
+
attr_accessor :expiresIn
|
48
46
|
alias_method :expires_in, :expiresIn
|
49
47
|
alias_method :expires_in=, :expiresIn=
|
50
48
|
|
51
|
-
|
52
|
-
|
53
|
-
alias_method :
|
54
|
-
alias_method :grant_type=, :grantType=
|
55
|
-
|
56
|
-
# Extra properties associated with the access token. (Property array)
|
57
|
-
attr_accessor :properties
|
49
|
+
attr_accessor :expiresAt
|
50
|
+
alias_method :expires_at, :expiresAt
|
51
|
+
alias_method :expires_at=, :expiresAt=
|
58
52
|
|
59
|
-
# The newly issued refresh token. (String)
|
60
53
|
attr_accessor :refreshToken
|
61
54
|
alias_method :refresh_token, :refreshToken
|
62
55
|
alias_method :refresh_token=, :refreshToken=
|
63
56
|
|
64
|
-
|
65
|
-
attr_accessor :scopes
|
57
|
+
attr_accessor :properties
|
66
58
|
|
67
|
-
|
68
|
-
# This is <tt>nil</tt> if the access token was created
|
69
|
-
# through {Client Credentials Flow}[https://tools.ietf.org/html/rfc6749#section-4.4].
|
70
|
-
# (String)
|
71
|
-
attr_accessor :subject
|
59
|
+
private
|
72
60
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
61
|
+
def defaults
|
62
|
+
super.merge(
|
63
|
+
action: nil,
|
64
|
+
grantType: nil,
|
65
|
+
clientId: 0,
|
66
|
+
subject: nil,
|
67
|
+
scopes: nil,
|
68
|
+
accessToken: nil,
|
69
|
+
tokenType: nil,
|
70
|
+
expiresIn: 0,
|
71
|
+
expiresAt: 0,
|
72
|
+
refreshToken: nil,
|
73
|
+
properties: nil
|
74
|
+
)
|
75
|
+
end
|
77
76
|
|
78
|
-
|
79
|
-
# from /api/auth/token/create API.
|
80
|
-
def initialize(hash = {})
|
77
|
+
def set_params(hash)
|
81
78
|
super(hash)
|
82
79
|
|
83
|
-
@action =
|
84
|
-
@
|
85
|
-
@clientId =
|
86
|
-
@
|
87
|
-
@
|
88
|
-
@
|
89
|
-
@
|
90
|
-
|
91
|
-
|
92
|
-
@refreshToken =
|
93
|
-
@
|
94
|
-
@subject = extract_value(hash, :subject)
|
95
|
-
@tokenType = extract_value(hash, :tokenType)
|
80
|
+
@action = hash[:action]
|
81
|
+
@grantType = hash[:grantType]
|
82
|
+
@clientId = hash[:clientId]
|
83
|
+
@subject = hash[:subject]
|
84
|
+
@scopes = hash[:scopes]
|
85
|
+
@accessToken = hash[:accessToken]
|
86
|
+
@tokenType = hash[:tokenType]
|
87
|
+
@expiresIn = hash[:expiresIn]
|
88
|
+
@expiresAt = hash[:expiresAt]
|
89
|
+
@refreshToken = hash[:refreshToken]
|
90
|
+
@properties = get_parsed_array(hash[:properties]) { |e| Authlete::Model::Property.parse(e) }
|
96
91
|
end
|
97
92
|
end
|
98
93
|
end
|
99
94
|
end
|
100
|
-
end
|
95
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
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,33 +18,30 @@
|
|
18
18
|
module Authlete
|
19
19
|
module Model
|
20
20
|
module Response
|
21
|
-
|
22
|
-
|
23
|
-
# This class represents a response from Authlete's /api/auth/token API.
|
24
|
-
class TokenFailRequest
|
25
|
-
include Authlete::Utility < Authlete::Model::Result
|
26
|
-
# The next action that the service implementation should take.
|
27
|
-
# (String)
|
21
|
+
class TokenFailResponse < Authlete::Model::Result
|
22
|
+
|
28
23
|
attr_accessor :action
|
29
24
|
|
30
|
-
# The response content which can be used to generate a response
|
31
|
-
# to the client application. The format of the value varies
|
32
|
-
# depending on the value of "action". (String)
|
33
25
|
attr_accessor :responseContent
|
34
26
|
alias_method :response_content, :responseContent
|
35
27
|
alias_method :response_content=, :responseContent=
|
36
28
|
|
37
29
|
private
|
38
30
|
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
def defaults
|
32
|
+
super.merge(
|
33
|
+
action: nil,
|
34
|
+
responseContent: nil
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def set_params(hash)
|
42
39
|
super(hash)
|
43
40
|
|
44
|
-
@action =
|
45
|
-
@responseContent =
|
41
|
+
@action = hash[:action]
|
42
|
+
@responseContent = hash[:responseContent]
|
46
43
|
end
|
47
44
|
end
|
48
45
|
end
|
49
46
|
end
|
50
|
-
end
|
47
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
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,122 +18,109 @@
|
|
18
18
|
module Authlete
|
19
19
|
module Model
|
20
20
|
module Response
|
21
|
-
# == Authlete::Model::Response::TokenIssueResponse class
|
22
|
-
#
|
23
|
-
# This class represents a response from Authlete's /api/auth/token/issue API.
|
24
21
|
class TokenIssueResponse < Authlete::Model::Result
|
25
22
|
include Authlete::Utility
|
26
|
-
|
27
|
-
# (String)
|
23
|
+
|
28
24
|
attr_accessor :action
|
29
25
|
|
30
|
-
# The response content which can be used to generate a response
|
31
|
-
# to the client application. The format of the value varies
|
32
|
-
# depending on the value of "action". (String)
|
33
26
|
attr_accessor :responseContent
|
34
27
|
alias_method :response_content, :responseContent
|
35
28
|
alias_method :response_content=, :responseContent=
|
36
29
|
|
37
|
-
# The newly issued access token. This parameter is a non-nil value
|
38
|
-
# only when the value of "action" parameter is "OK". (String)
|
39
30
|
attr_accessor :accessToken
|
40
31
|
alias_method :access_token, :accessToken
|
41
32
|
alias_method :access_token=, :accessToken=
|
42
33
|
|
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
34
|
attr_accessor :accessTokenExpiresAt
|
47
35
|
alias_method :access_token_expires_at, :accessTokenExpiresAt
|
48
36
|
alias_method :access_token_expires_at=, :accessTokenExpiresAt=
|
49
37
|
|
50
|
-
# The duration of the newly issued access token in seconds. (Integer)
|
51
38
|
attr_accessor :accessTokenDuration
|
52
39
|
alias_method :access_token_duration, :accessTokenDuration
|
53
40
|
alias_method :access_token_duration=, :accessTokenDuration=
|
54
41
|
|
55
|
-
# The refresh token. This parameter is a non-nil value only when
|
56
|
-
# "action" = "OK" and the service supports the refresh token flow.
|
57
|
-
# If "Refresh Token Continuous Use" configuration parameter is "NO"
|
58
|
-
# (= refreshTokenKept=false), a new refresh token is issued and the
|
59
|
-
# old refresh token used in the refresh token flow is invalidated.
|
60
|
-
# On the contrary, if the configuration parameter is "YES", the refresh
|
61
|
-
# token itself is not refreshed. (String)
|
62
42
|
attr_accessor :refreshToken
|
63
43
|
alias_method :refresh_token, :refreshToken
|
64
44
|
alias_method :refresh_token=, :refreshToken=
|
65
45
|
|
66
|
-
# The datetime at which the newly issued refresh token will expire.
|
67
|
-
# The value is represented in milliseconds since the Unix epoch (1970-01-01).
|
68
|
-
# (Integer)
|
69
46
|
attr_accessor :refreshTokenExpiresAt
|
70
47
|
alias_method :refresh_token_expires_at, :refreshTokenExpiresAt
|
71
48
|
alias_method :refresh_token_expires_at=, :refreshTokenExpiresAt=
|
72
49
|
|
73
|
-
# The duration of the newly issued refresh token in seconds. (Integer)
|
74
50
|
attr_accessor :refreshTokenDuration
|
75
51
|
alias_method :refresh_token_duration, :refreshTokenDuration
|
76
52
|
alias_method :refresh_token_duration=, :refreshTokenDuration=
|
77
53
|
|
78
|
-
# The client ID. (Integer)
|
79
54
|
attr_accessor :clientId
|
80
55
|
alias_method :client_id, :clientId
|
81
56
|
alias_method :client_id=, :clientId=
|
82
57
|
|
83
|
-
# If the client did not have an alias, this parameter is nil. (String)
|
84
58
|
attr_accessor :clientIdAlias
|
85
59
|
alias_method :client_id_alias, :clientIdAlias
|
86
60
|
alias_method :client_id_alias=, :clientIdAlias=
|
87
61
|
|
88
|
-
# The flag which indicates whether the client ID alias was used when
|
89
|
-
# the token request was made. "true" if the client ID alias was used
|
90
|
-
# when the token request was made. (Boolean)
|
91
62
|
attr_accessor :clientIdAliasUsed
|
92
63
|
alias_method :client_id_alias_used, :clientIdAliasUsed
|
93
64
|
alias_method :client_id_alias_used=, :clientIdAliasUsed=
|
94
65
|
|
95
|
-
# The subject (= resource owner's ID) of the access token.
|
96
|
-
# Even if an access token has been issued by the call of /api/auth/token API,
|
97
|
-
# this parameter is "nil" if the flow of the token request was "Client Credentials Flow"
|
98
|
-
# (grant_type=client_credentials) because it means the access token
|
99
|
-
# is not associated with any specific end-user.
|
100
|
-
# (String)
|
101
66
|
attr_accessor :subject
|
102
67
|
|
103
|
-
# The scopes covered by the access token.
|
104
|
-
# (Scope array)
|
105
68
|
attr_accessor :scopes
|
106
69
|
|
107
|
-
# The extra properties associated with the access token.
|
108
|
-
# This parameter is "nil" when no extra property is associated with
|
109
|
-
# the issued access token.
|
110
70
|
attr_accessor :properties
|
111
71
|
|
72
|
+
attr_accessor :jwtAccessToken
|
73
|
+
alias_method :jwt_access_token, :jwtAccessToken
|
74
|
+
alias_method :jwt_access_token=, :jwtAccessToken=
|
75
|
+
|
76
|
+
attr_accessor :accessTokenResources
|
77
|
+
alias_method :access_token_resources, :accessTokenResources
|
78
|
+
alias_method :access_token_resources=, :accessTokenResources=
|
79
|
+
|
112
80
|
private
|
113
81
|
|
114
|
-
|
115
|
-
|
116
|
-
|
82
|
+
def defaults
|
83
|
+
super.merge(
|
84
|
+
action: nil,
|
85
|
+
responseContent: nil,
|
86
|
+
accessToken: nil,
|
87
|
+
accessTokenExpiresAt: 0,
|
88
|
+
accessTokenDuration: 0,
|
89
|
+
refreshToken: nil,
|
90
|
+
refreshTokenExpiresAt: 0,
|
91
|
+
refreshTokenDuration: 0,
|
92
|
+
clientId: 0,
|
93
|
+
clientIdAlias: nil,
|
94
|
+
clientIdAliasUsed: false,
|
95
|
+
subject: nil,
|
96
|
+
scopes: nil,
|
97
|
+
properties: nil,
|
98
|
+
jwtAccessToken: nil,
|
99
|
+
accessTokenResources: nil
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
def set_params(hash)
|
117
104
|
super(hash)
|
118
105
|
|
119
|
-
@action =
|
120
|
-
@responseContent =
|
121
|
-
@accessToken =
|
122
|
-
@accessTokenExpiresAt =
|
123
|
-
@accessTokenDuration =
|
124
|
-
@refreshToken =
|
125
|
-
@refreshTokenExpiresAt =
|
126
|
-
@refreshTokenDuration =
|
127
|
-
@clientId =
|
128
|
-
@clientIdAlias =
|
129
|
-
@clientIdAliasUsed =
|
130
|
-
@subject =
|
131
|
-
@scopes =
|
132
|
-
@properties =
|
133
|
-
|
134
|
-
|
106
|
+
@action = hash[:action]
|
107
|
+
@responseContent = hash[:responseContent]
|
108
|
+
@accessToken = hash[:accessToken]
|
109
|
+
@accessTokenExpiresAt = hash[:accessTokenExpiresAt]
|
110
|
+
@accessTokenDuration = hash[:accessTokenDuration]
|
111
|
+
@refreshToken = hash[:refreshToken]
|
112
|
+
@refreshTokenExpiresAt = hash[:refreshTokenExpiresAt]
|
113
|
+
@refreshTokenDuration = hash[:refreshTokenDuration]
|
114
|
+
@clientId = hash[:clientId]
|
115
|
+
@clientIdAlias = hash[:clientIdAlias]
|
116
|
+
@clientIdAliasUsed = hash[:clientIdAliasUsed]
|
117
|
+
@subject = hash[:subject]
|
118
|
+
@scopes = hash[:scopes]
|
119
|
+
@properties = get_parsed_array(hash[:properties]) { |e| Authlete::Model::Property.parse(e) }
|
120
|
+
@jwtAccessToken = hash[:jwtAccessToken]
|
121
|
+
@accessTokenResources = hash[:accessTokenResources]
|
135
122
|
end
|
136
123
|
end
|
137
124
|
end
|
138
125
|
end
|
139
|
-
end
|
126
|
+
end
|