authlete 1.38.0 → 1.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +38 -0
- data/authlete.gemspec +1 -2
- data/lib/authlete/api.rb +17 -0
- data/lib/authlete/logging.rb +94 -0
- data/lib/authlete/model/service.rb +7 -1
- data/lib/authlete/version.rb +1 -1
- data/lib/authlete.rb +3 -0
- metadata +5 -167
- data/test/authlete/model/request/test_authentication-callback-request.rb +0 -100
- data/test/authlete/model/request/test_authorization-fail-request.rb +0 -67
- data/test/authlete/model/request/test_authorization-issue-request.rb +0 -94
- data/test/authlete/model/request/test_authorization-request.rb +0 -57
- data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +0 -102
- data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +0 -71
- data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +0 -57
- data/test/authlete/model/request/test_backchannel-authentication-request.rb +0 -75
- data/test/authlete/model/request/test_client-authorization-delete-request.rb +0 -57
- data/test/authlete/model/request/test_client-authorization-get-list-request.rb +0 -71
- data/test/authlete/model/request/test_client-authorization-update-request.rb +0 -63
- data/test/authlete/model/request/test_client-registration-request.rb +0 -68
- data/test/authlete/model/request/test_device-authorization-request.rb +0 -75
- data/test/authlete/model/request/test_device-complete-request.rb +0 -102
- data/test/authlete/model/request/test_device-verification-request.rb +0 -57
- data/test/authlete/model/request/test_granted-scopes-request.rb +0 -57
- data/test/authlete/model/request/test_introspection-request.rb +0 -79
- data/test/authlete/model/request/test_pushed-auth-req-request.rb +0 -75
- data/test/authlete/model/request/test_revocation-request.rb +0 -67
- data/test/authlete/model/request/test_standard-introspection-request.rb +0 -57
- data/test/authlete/model/request/test_token-create-request.rb +0 -110
- data/test/authlete/model/request/test_token-fail-request.rb +0 -63
- data/test/authlete/model/request/test_token-issue-request.rb +0 -70
- data/test/authlete/model/request/test_token-request.rb +0 -94
- data/test/authlete/model/request/test_token-revoke-request.rb +0 -71
- data/test/authlete/model/request/test_token-update-request.rb +0 -82
- data/test/authlete/model/request/test_user-info-issue-request.rb +0 -67
- data/test/authlete/model/request/test_user-info-request.rb +0 -75
- data/test/authlete/model/response/test_access-token.rb +0 -101
- data/test/authlete/model/response/test_authorization-fail-response.rb +0 -68
- data/test/authlete/model/response/test_authorization-issue-response.rb +0 -92
- data/test/authlete/model/response/test_authorization-response.rb +0 -145
- data/test/authlete/model/response/test_authorized-client-list-response.rb +0 -83
- data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +0 -132
- data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +0 -68
- data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +0 -80
- data/test/authlete/model/response/test_backchannel-authentication-response.rb +0 -156
- data/test/authlete/model/response/test_client-list-response.rb +0 -79
- data/test/authlete/model/response/test_client-secret-refresh-response.rb +0 -68
- data/test/authlete/model/response/test_client-secret-update-response.rb +0 -68
- data/test/authlete/model/response/test_device-authorization-response.rb +0 -140
- data/test/authlete/model/response/test_device-complete-response.rb +0 -64
- data/test/authlete/model/response/test_device-verification-response.rb +0 -112
- data/test/authlete/model/response/test_granted-scopes-get-response.rb +0 -84
- data/test/authlete/model/response/test_introspection-response.rb +0 -127
- data/test/authlete/model/response/test_pushed-auth-req-response.rb +0 -76
- data/test/authlete/model/response/test_revocation-response.rb +0 -68
- data/test/authlete/model/response/test_service-list-response.rb +0 -72
- data/test/authlete/model/response/test_standard-introspection-response.rb +0 -68
- data/test/authlete/model/response/test_token-create-response.rb +0 -107
- data/test/authlete/model/response/test_token-fail-response.rb +0 -68
- data/test/authlete/model/response/test_token-issue-response.rb +0 -127
- data/test/authlete/model/response/test_token-list-response.rb +0 -84
- data/test/authlete/model/response/test_token-response.rb +0 -147
- data/test/authlete/model/response/test_token-revoke-response.rb +0 -63
- data/test/authlete/model/response/test_token-update-response.rb +0 -87
- data/test/authlete/model/response/test_user-info-issue-response.rb +0 -68
- data/test/authlete/model/response/test_user-info-response.rb +0 -107
- data/test/authlete/model/test_client-extension.rb +0 -98
- data/test/authlete/model/test_client.rb +0 -604
- data/test/authlete/model/test_hsk.rb +0 -108
- data/test/authlete/model/test_named-uri.rb +0 -83
- data/test/authlete/model/test_pair.rb +0 -83
- data/test/authlete/model/test_property.rb +0 -88
- data/test/authlete/model/test_result.rb +0 -68
- data/test/authlete/model/test_scope.rb +0 -104
- data/test/authlete/model/test_service-owner.rb +0 -80
- data/test/authlete/model/test_service.rb +0 -896
- data/test/authlete/model/test_sns-credentials.rb +0 -88
- data/test/authlete/model/test_tagged-value.rb +0 -83
- data/test/authlete/model/test_trust-anchor.rb +0 -84
- data/test/authlete/test_exception.rb +0 -70
- data/test/authlete/types/test_application-type.rb +0 -44
- data/test/authlete/types/test_client-auth-method.rb +0 -64
- data/test/authlete/types/test_delivery-mode.rb +0 -48
- data/test/authlete/types/test_grant-type.rb +0 -72
- data/test/authlete/types/test_jwealg.rb +0 -104
- data/test/authlete/types/test_jweenc.rb +0 -60
- data/test/authlete/types/test_jwsalg.rb +0 -96
- data/test/authlete/types/test_response-type.rb +0 -68
- data/test/authlete/types/test_subject-type.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 74a860b721b7613f2db6d38a29c773099a775a6a2db4cad9aee401acfc5c3720
|
4
|
+
data.tar.gz: a9f1de04dc44a566132358b9f90c5c72db7e8e05891c9bb8b48f32c5394c47a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdcaef0259445a1ba5067fbc5fd7e3f97cbf8f1ee01c5b7b346ce379e3cbe11447be47893e5b7d39cebd0feacc8d108df2fe7aede2cff8410de3831b8300bd6
|
7
|
+
data.tar.gz: 19d66a165c4d2cebdc19dcc35f2c8dcf72f964b5a5a5bd15fdf195106290d495e728608bd69658cb4e4820c9b87243c1fe56b95aa8d10cdb5e6b06d087baf06d
|
data/README.md
CHANGED
@@ -6,6 +6,44 @@ authlete-ruby-gem
|
|
6
6
|
Ruby library for [Authlete Web APIs](https://docs.authlete.com/).
|
7
7
|
|
8
8
|
|
9
|
+
# REST Client Logging Configuration
|
10
|
+
|
11
|
+
The library provides control over `rest-client` logging behavior through `Authlete::LoggingLevel`:
|
12
|
+
|
13
|
+
- `DEFAULT` - Respects the logger set in `RestClient.log` (default behavior)
|
14
|
+
- `SENSITIVE` - Logs all information but redacts sensitive data (tokens, credentials)
|
15
|
+
- `NONE` - Disables all logging, useful for handling sensitive PII data
|
16
|
+
|
17
|
+
Example configuration:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
# Default behavior (uses RestClient.log as is)
|
21
|
+
config = {
|
22
|
+
host: 'https://api.authlete.com',
|
23
|
+
service_api_key: 'YOUR_KEY',
|
24
|
+
service_api_secret: 'YOUR_SECRET',
|
25
|
+
rest_client_logging_level: Authlete::LoggingLevel::DEFAULT
|
26
|
+
}
|
27
|
+
|
28
|
+
# Redact sensitive data
|
29
|
+
config = {
|
30
|
+
host: 'https://api.authlete.com',
|
31
|
+
service_api_key: 'YOUR_KEY',
|
32
|
+
service_api_secret: 'YOUR_SECRET',
|
33
|
+
rest_client_logging_level: Authlete::LoggingLevel::SENSITIVE
|
34
|
+
}
|
35
|
+
|
36
|
+
# Disable all RestClient logging
|
37
|
+
config = {
|
38
|
+
host: 'https://api.authlete.com',
|
39
|
+
service_api_key: 'YOUR_KEY',
|
40
|
+
service_api_secret: 'YOUR_SECRET',
|
41
|
+
rest_client_logging_level: Authlete::LoggingLevel::NONE
|
42
|
+
}
|
43
|
+
|
44
|
+
api_client = Authlete::Api.new(config)
|
45
|
+
```
|
46
|
+
|
9
47
|
# License
|
10
48
|
|
11
49
|
Apache License, Version 2.0
|
data/authlete.gemspec
CHANGED
@@ -13,9 +13,8 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://www.authlete.com/"
|
14
14
|
spec.license = "Apache License, Version 2.0"
|
15
15
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?("test/") }
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
18
|
spec.require_paths = ["lib"]
|
20
19
|
|
21
20
|
spec.add_runtime_dependency "rest-client", ">= 1.7.2"
|
data/lib/authlete/api.rb
CHANGED
@@ -40,6 +40,23 @@ module Authlete
|
|
40
40
|
@service_api_key = config[:service_api_key]
|
41
41
|
@service_api_secret = config[:service_api_secret]
|
42
42
|
@extra_headers = nil
|
43
|
+
|
44
|
+
configure_logging(config[:rest_client_logging_level])
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def configure_logging(level)
|
50
|
+
return unless RestClient.log
|
51
|
+
|
52
|
+
case level
|
53
|
+
when LoggingLevel::SENSITIVE
|
54
|
+
RestClient.log = Authlete::SensitiveLogger.new(RestClient.log)
|
55
|
+
when LoggingLevel::NONE
|
56
|
+
RestClient.log = Authlete::NullLogger.new
|
57
|
+
when LoggingLevel::DEFAULT, nil
|
58
|
+
# Keep original logger (default behavior)
|
59
|
+
end
|
43
60
|
end
|
44
61
|
|
45
62
|
def call_api(method, path, content_type, payload, user, password)
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Authlete
|
2
|
+
module LoggingLevel
|
3
|
+
DEFAULT = :default # Original logging behavior
|
4
|
+
SENSITIVE = :sensitive # Redact sensitive data
|
5
|
+
NONE = :none # No logging
|
6
|
+
end
|
7
|
+
|
8
|
+
class NullLogger
|
9
|
+
def <<(msg)
|
10
|
+
# NOOP
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class SensitiveLogger
|
15
|
+
SENSITIVE_FIELDS = [
|
16
|
+
# OAuth/OIDC related
|
17
|
+
'client_secret',
|
18
|
+
'access_token',
|
19
|
+
'refresh_token',
|
20
|
+
'authorization_code',
|
21
|
+
'id_token',
|
22
|
+
'code',
|
23
|
+
# Device flow
|
24
|
+
'user_code',
|
25
|
+
'client_notification_token',
|
26
|
+
|
27
|
+
# Authlete Credentials
|
28
|
+
'service_api_key',
|
29
|
+
'service_api_secret',
|
30
|
+
'service_owner_api_key',
|
31
|
+
'service_owner_api_secret',
|
32
|
+
'sns_credentials',
|
33
|
+
'developer_sns_credentials',
|
34
|
+
'ticket',
|
35
|
+
'subject',
|
36
|
+
|
37
|
+
# Authentication & Authorization
|
38
|
+
'password',
|
39
|
+
'token',
|
40
|
+
'authorization',
|
41
|
+
'client_certificate',
|
42
|
+
'client_certificate_path',
|
43
|
+
|
44
|
+
# JWT/Crypto/Certificate related
|
45
|
+
'jwks',
|
46
|
+
'federation_jwks',
|
47
|
+
'client_secret_expires_at',
|
48
|
+
'trusted_root_certificates',
|
49
|
+
'encryption_key_id',
|
50
|
+
'signature_key_id',
|
51
|
+
'access_token_signature_key_id',
|
52
|
+
'refresh_token_signature_key_id',
|
53
|
+
'id_token_signature_key_id'
|
54
|
+
].freeze
|
55
|
+
|
56
|
+
SENSITIVE_PATTERNS = SENSITIVE_FIELDS.flat_map do |field|
|
57
|
+
[
|
58
|
+
# JSON format
|
59
|
+
/("#{field}"\s*:\s*)"[^"]*"/,
|
60
|
+
# URL-encoded format
|
61
|
+
/#{field}=([^&\s]+)/
|
62
|
+
]
|
63
|
+
end.freeze
|
64
|
+
|
65
|
+
REDACTION_MARK = '***** REDACTED *****'
|
66
|
+
|
67
|
+
def initialize(original_logger)
|
68
|
+
@original_logger = original_logger
|
69
|
+
end
|
70
|
+
|
71
|
+
def <<(msg)
|
72
|
+
redacted_msg = redact_sensitive_data(msg)
|
73
|
+
@original_logger << redacted_msg
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def redact_sensitive_data(msg)
|
79
|
+
return msg unless msg.is_a?(String)
|
80
|
+
|
81
|
+
redacted = msg.dup
|
82
|
+
SENSITIVE_PATTERNS.each do |pattern|
|
83
|
+
if pattern.to_s.include?('"')
|
84
|
+
# JSON format
|
85
|
+
redacted.gsub!(pattern, "\\1#{REDACTION_MARK.inspect}")
|
86
|
+
else
|
87
|
+
# URL-encoded format
|
88
|
+
redacted.gsub!(pattern) { "#{$~[0].split('=')[0]}=#{REDACTION_MARK}" }
|
89
|
+
end
|
90
|
+
end
|
91
|
+
redacted
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -635,6 +635,10 @@ module Authlete
|
|
635
635
|
alias_method :id_token_reissuable, :idTokenReissuable
|
636
636
|
alias_method :id_token_reissuable=, :idTokenReissuable=
|
637
637
|
|
638
|
+
attr_accessor :clientAssertionAudRestrictedToIssuer
|
639
|
+
alias_method :client_assertion_aud_restricted_to_issuer, :clientAssertionAudRestrictedToIssuer
|
640
|
+
alias_method :client_assertion_aud_restricted_to_issuer=, :clientAssertionAudRestrictedToIssuer=
|
641
|
+
|
638
642
|
private
|
639
643
|
|
640
644
|
def defaults
|
@@ -796,6 +800,7 @@ module Authlete
|
|
796
800
|
credentialDuration: 0,
|
797
801
|
credentialJwks: nil,
|
798
802
|
idTokenReissuable: false,
|
803
|
+
clientAssertionAudRestrictedToIssuer: false,
|
799
804
|
}
|
800
805
|
end
|
801
806
|
|
@@ -957,7 +962,8 @@ module Authlete
|
|
957
962
|
@credentialDuration = hash[:credentialDuration]
|
958
963
|
@credentialJwks = hash[:credentialJwks]
|
959
964
|
@idTokenReissuable = hash[:idTokenReissuable]
|
960
|
-
|
965
|
+
@clientAssertionAudRestrictedToIssuer = hash[:clientAssertionAudRestrictedToIssuer]
|
966
|
+
|
961
967
|
end
|
962
968
|
|
963
969
|
def to_hash_value(key, var)
|
data/lib/authlete/version.rb
CHANGED
data/lib/authlete.rb
CHANGED
@@ -24,6 +24,9 @@ module Authlete
|
|
24
24
|
autoload :Exception, 'authlete/exception'
|
25
25
|
autoload :ParamInitializer, 'authlete/model/param-initializer'
|
26
26
|
autoload :Utility, 'authlete/utility'
|
27
|
+
autoload :LoggingLevel, 'authlete/logging'
|
28
|
+
autoload :NullLogger, 'authlete/logging'
|
29
|
+
autoload :SensitiveLogger, 'authlete/logging'
|
27
30
|
|
28
31
|
module Model
|
29
32
|
autoload :Base, 'authlete/model/base'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-02-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/authlete/api.rb
|
73
73
|
- lib/authlete/authentication-server.rb
|
74
74
|
- lib/authlete/exception.rb
|
75
|
+
- lib/authlete/logging.rb
|
75
76
|
- lib/authlete/model/base.rb
|
76
77
|
- lib/authlete/model/client-extension.rb
|
77
78
|
- lib/authlete/model/client.rb
|
@@ -164,87 +165,6 @@ files:
|
|
164
165
|
- lib/authlete/types/subject-type.rb
|
165
166
|
- lib/authlete/utility.rb
|
166
167
|
- lib/authlete/version.rb
|
167
|
-
- test/authlete/model/request/test_authentication-callback-request.rb
|
168
|
-
- test/authlete/model/request/test_authorization-fail-request.rb
|
169
|
-
- test/authlete/model/request/test_authorization-issue-request.rb
|
170
|
-
- test/authlete/model/request/test_authorization-request.rb
|
171
|
-
- test/authlete/model/request/test_backchannel-authentication-complete-request.rb
|
172
|
-
- test/authlete/model/request/test_backchannel-authentication-fail-request.rb
|
173
|
-
- test/authlete/model/request/test_backchannel-authentication-issue-request.rb
|
174
|
-
- test/authlete/model/request/test_backchannel-authentication-request.rb
|
175
|
-
- test/authlete/model/request/test_client-authorization-delete-request.rb
|
176
|
-
- test/authlete/model/request/test_client-authorization-get-list-request.rb
|
177
|
-
- test/authlete/model/request/test_client-authorization-update-request.rb
|
178
|
-
- test/authlete/model/request/test_client-registration-request.rb
|
179
|
-
- test/authlete/model/request/test_device-authorization-request.rb
|
180
|
-
- test/authlete/model/request/test_device-complete-request.rb
|
181
|
-
- test/authlete/model/request/test_device-verification-request.rb
|
182
|
-
- test/authlete/model/request/test_granted-scopes-request.rb
|
183
|
-
- test/authlete/model/request/test_introspection-request.rb
|
184
|
-
- test/authlete/model/request/test_pushed-auth-req-request.rb
|
185
|
-
- test/authlete/model/request/test_revocation-request.rb
|
186
|
-
- test/authlete/model/request/test_standard-introspection-request.rb
|
187
|
-
- test/authlete/model/request/test_token-create-request.rb
|
188
|
-
- test/authlete/model/request/test_token-fail-request.rb
|
189
|
-
- test/authlete/model/request/test_token-issue-request.rb
|
190
|
-
- test/authlete/model/request/test_token-request.rb
|
191
|
-
- test/authlete/model/request/test_token-revoke-request.rb
|
192
|
-
- test/authlete/model/request/test_token-update-request.rb
|
193
|
-
- test/authlete/model/request/test_user-info-issue-request.rb
|
194
|
-
- test/authlete/model/request/test_user-info-request.rb
|
195
|
-
- test/authlete/model/response/test_access-token.rb
|
196
|
-
- test/authlete/model/response/test_authorization-fail-response.rb
|
197
|
-
- test/authlete/model/response/test_authorization-issue-response.rb
|
198
|
-
- test/authlete/model/response/test_authorization-response.rb
|
199
|
-
- test/authlete/model/response/test_authorized-client-list-response.rb
|
200
|
-
- test/authlete/model/response/test_backchannel-authentication-complete-response.rb
|
201
|
-
- test/authlete/model/response/test_backchannel-authentication-fail-response.rb
|
202
|
-
- test/authlete/model/response/test_backchannel-authentication-issue-response.rb
|
203
|
-
- test/authlete/model/response/test_backchannel-authentication-response.rb
|
204
|
-
- test/authlete/model/response/test_client-list-response.rb
|
205
|
-
- test/authlete/model/response/test_client-secret-refresh-response.rb
|
206
|
-
- test/authlete/model/response/test_client-secret-update-response.rb
|
207
|
-
- test/authlete/model/response/test_device-authorization-response.rb
|
208
|
-
- test/authlete/model/response/test_device-complete-response.rb
|
209
|
-
- test/authlete/model/response/test_device-verification-response.rb
|
210
|
-
- test/authlete/model/response/test_granted-scopes-get-response.rb
|
211
|
-
- test/authlete/model/response/test_introspection-response.rb
|
212
|
-
- test/authlete/model/response/test_pushed-auth-req-response.rb
|
213
|
-
- test/authlete/model/response/test_revocation-response.rb
|
214
|
-
- test/authlete/model/response/test_service-list-response.rb
|
215
|
-
- test/authlete/model/response/test_standard-introspection-response.rb
|
216
|
-
- test/authlete/model/response/test_token-create-response.rb
|
217
|
-
- test/authlete/model/response/test_token-fail-response.rb
|
218
|
-
- test/authlete/model/response/test_token-issue-response.rb
|
219
|
-
- test/authlete/model/response/test_token-list-response.rb
|
220
|
-
- test/authlete/model/response/test_token-response.rb
|
221
|
-
- test/authlete/model/response/test_token-revoke-response.rb
|
222
|
-
- test/authlete/model/response/test_token-update-response.rb
|
223
|
-
- test/authlete/model/response/test_user-info-issue-response.rb
|
224
|
-
- test/authlete/model/response/test_user-info-response.rb
|
225
|
-
- test/authlete/model/test_client-extension.rb
|
226
|
-
- test/authlete/model/test_client.rb
|
227
|
-
- test/authlete/model/test_hsk.rb
|
228
|
-
- test/authlete/model/test_named-uri.rb
|
229
|
-
- test/authlete/model/test_pair.rb
|
230
|
-
- test/authlete/model/test_property.rb
|
231
|
-
- test/authlete/model/test_result.rb
|
232
|
-
- test/authlete/model/test_scope.rb
|
233
|
-
- test/authlete/model/test_service-owner.rb
|
234
|
-
- test/authlete/model/test_service.rb
|
235
|
-
- test/authlete/model/test_sns-credentials.rb
|
236
|
-
- test/authlete/model/test_tagged-value.rb
|
237
|
-
- test/authlete/model/test_trust-anchor.rb
|
238
|
-
- test/authlete/test_exception.rb
|
239
|
-
- test/authlete/types/test_application-type.rb
|
240
|
-
- test/authlete/types/test_client-auth-method.rb
|
241
|
-
- test/authlete/types/test_delivery-mode.rb
|
242
|
-
- test/authlete/types/test_grant-type.rb
|
243
|
-
- test/authlete/types/test_jwealg.rb
|
244
|
-
- test/authlete/types/test_jweenc.rb
|
245
|
-
- test/authlete/types/test_jwsalg.rb
|
246
|
-
- test/authlete/types/test_response-type.rb
|
247
|
-
- test/authlete/types/test_subject-type.rb
|
248
168
|
homepage: https://www.authlete.com/
|
249
169
|
licenses:
|
250
170
|
- Apache License, Version 2.0
|
@@ -264,90 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
184
|
- !ruby/object:Gem::Version
|
265
185
|
version: '0'
|
266
186
|
requirements: []
|
267
|
-
|
268
|
-
rubygems_version: 2.6.8
|
187
|
+
rubygems_version: 3.4.10
|
269
188
|
signing_key:
|
270
189
|
specification_version: 4
|
271
190
|
summary: A library for Authlete Web APIs
|
272
|
-
test_files:
|
273
|
-
- test/authlete/model/request/test_authentication-callback-request.rb
|
274
|
-
- test/authlete/model/request/test_authorization-fail-request.rb
|
275
|
-
- test/authlete/model/request/test_authorization-issue-request.rb
|
276
|
-
- test/authlete/model/request/test_authorization-request.rb
|
277
|
-
- test/authlete/model/request/test_backchannel-authentication-complete-request.rb
|
278
|
-
- test/authlete/model/request/test_backchannel-authentication-fail-request.rb
|
279
|
-
- test/authlete/model/request/test_backchannel-authentication-issue-request.rb
|
280
|
-
- test/authlete/model/request/test_backchannel-authentication-request.rb
|
281
|
-
- test/authlete/model/request/test_client-authorization-delete-request.rb
|
282
|
-
- test/authlete/model/request/test_client-authorization-get-list-request.rb
|
283
|
-
- test/authlete/model/request/test_client-authorization-update-request.rb
|
284
|
-
- test/authlete/model/request/test_client-registration-request.rb
|
285
|
-
- test/authlete/model/request/test_device-authorization-request.rb
|
286
|
-
- test/authlete/model/request/test_device-complete-request.rb
|
287
|
-
- test/authlete/model/request/test_device-verification-request.rb
|
288
|
-
- test/authlete/model/request/test_granted-scopes-request.rb
|
289
|
-
- test/authlete/model/request/test_introspection-request.rb
|
290
|
-
- test/authlete/model/request/test_pushed-auth-req-request.rb
|
291
|
-
- test/authlete/model/request/test_revocation-request.rb
|
292
|
-
- test/authlete/model/request/test_standard-introspection-request.rb
|
293
|
-
- test/authlete/model/request/test_token-create-request.rb
|
294
|
-
- test/authlete/model/request/test_token-fail-request.rb
|
295
|
-
- test/authlete/model/request/test_token-issue-request.rb
|
296
|
-
- test/authlete/model/request/test_token-request.rb
|
297
|
-
- test/authlete/model/request/test_token-revoke-request.rb
|
298
|
-
- test/authlete/model/request/test_token-update-request.rb
|
299
|
-
- test/authlete/model/request/test_user-info-issue-request.rb
|
300
|
-
- test/authlete/model/request/test_user-info-request.rb
|
301
|
-
- test/authlete/model/response/test_access-token.rb
|
302
|
-
- test/authlete/model/response/test_authorization-fail-response.rb
|
303
|
-
- test/authlete/model/response/test_authorization-issue-response.rb
|
304
|
-
- test/authlete/model/response/test_authorization-response.rb
|
305
|
-
- test/authlete/model/response/test_authorized-client-list-response.rb
|
306
|
-
- test/authlete/model/response/test_backchannel-authentication-complete-response.rb
|
307
|
-
- test/authlete/model/response/test_backchannel-authentication-fail-response.rb
|
308
|
-
- test/authlete/model/response/test_backchannel-authentication-issue-response.rb
|
309
|
-
- test/authlete/model/response/test_backchannel-authentication-response.rb
|
310
|
-
- test/authlete/model/response/test_client-list-response.rb
|
311
|
-
- test/authlete/model/response/test_client-secret-refresh-response.rb
|
312
|
-
- test/authlete/model/response/test_client-secret-update-response.rb
|
313
|
-
- test/authlete/model/response/test_device-authorization-response.rb
|
314
|
-
- test/authlete/model/response/test_device-complete-response.rb
|
315
|
-
- test/authlete/model/response/test_device-verification-response.rb
|
316
|
-
- test/authlete/model/response/test_granted-scopes-get-response.rb
|
317
|
-
- test/authlete/model/response/test_introspection-response.rb
|
318
|
-
- test/authlete/model/response/test_pushed-auth-req-response.rb
|
319
|
-
- test/authlete/model/response/test_revocation-response.rb
|
320
|
-
- test/authlete/model/response/test_service-list-response.rb
|
321
|
-
- test/authlete/model/response/test_standard-introspection-response.rb
|
322
|
-
- test/authlete/model/response/test_token-create-response.rb
|
323
|
-
- test/authlete/model/response/test_token-fail-response.rb
|
324
|
-
- test/authlete/model/response/test_token-issue-response.rb
|
325
|
-
- test/authlete/model/response/test_token-list-response.rb
|
326
|
-
- test/authlete/model/response/test_token-response.rb
|
327
|
-
- test/authlete/model/response/test_token-revoke-response.rb
|
328
|
-
- test/authlete/model/response/test_token-update-response.rb
|
329
|
-
- test/authlete/model/response/test_user-info-issue-response.rb
|
330
|
-
- test/authlete/model/response/test_user-info-response.rb
|
331
|
-
- test/authlete/model/test_client-extension.rb
|
332
|
-
- test/authlete/model/test_client.rb
|
333
|
-
- test/authlete/model/test_hsk.rb
|
334
|
-
- test/authlete/model/test_named-uri.rb
|
335
|
-
- test/authlete/model/test_pair.rb
|
336
|
-
- test/authlete/model/test_property.rb
|
337
|
-
- test/authlete/model/test_result.rb
|
338
|
-
- test/authlete/model/test_scope.rb
|
339
|
-
- test/authlete/model/test_service-owner.rb
|
340
|
-
- test/authlete/model/test_service.rb
|
341
|
-
- test/authlete/model/test_sns-credentials.rb
|
342
|
-
- test/authlete/model/test_tagged-value.rb
|
343
|
-
- test/authlete/model/test_trust-anchor.rb
|
344
|
-
- test/authlete/test_exception.rb
|
345
|
-
- test/authlete/types/test_application-type.rb
|
346
|
-
- test/authlete/types/test_client-auth-method.rb
|
347
|
-
- test/authlete/types/test_delivery-mode.rb
|
348
|
-
- test/authlete/types/test_grant-type.rb
|
349
|
-
- test/authlete/types/test_jwealg.rb
|
350
|
-
- test/authlete/types/test_jweenc.rb
|
351
|
-
- test/authlete/types/test_jwsalg.rb
|
352
|
-
- test/authlete/types/test_response-type.rb
|
353
|
-
- test/authlete/types/test_subject-type.rb
|
191
|
+
test_files: []
|
@@ -1,100 +0,0 @@
|
|
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
|
-
require 'authlete'
|
19
|
-
require 'minitest/autorun'
|
20
|
-
|
21
|
-
|
22
|
-
class AuthenticationCallbackRequestTest < Minitest::Test
|
23
|
-
SERVICE_API_KEY = '<service-api-key>'
|
24
|
-
CLIENT_ID = 12345
|
25
|
-
ID = '<id>'
|
26
|
-
PASSWORD = '<password>'
|
27
|
-
CLAIMS = [ 'claim0', 'claim1' ]
|
28
|
-
CLAIMS_LOCALES = [ 'en', 'ja' ]
|
29
|
-
SNS = 'FACEBOOK'
|
30
|
-
ACCESS_TOKEN = '<access-token>'
|
31
|
-
REFRESH_TOKEN = '<refresh-token>'
|
32
|
-
EXPIRES_IN = 30000
|
33
|
-
RAW_TOKEN_RESPONSE = '<raw-token-response>'
|
34
|
-
|
35
|
-
|
36
|
-
def set_params(obj)
|
37
|
-
obj.service_api_key = SERVICE_API_KEY
|
38
|
-
obj.client_id = CLIENT_ID
|
39
|
-
obj.id = ID
|
40
|
-
obj.password = PASSWORD
|
41
|
-
obj.claims = CLAIMS
|
42
|
-
obj.claims_locales = CLAIMS_LOCALES
|
43
|
-
obj.sns = SNS
|
44
|
-
obj.access_token = ACCESS_TOKEN
|
45
|
-
obj.refresh_token = REFRESH_TOKEN
|
46
|
-
obj.expires_in = EXPIRES_IN
|
47
|
-
obj.raw_token_response = RAW_TOKEN_RESPONSE
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
def match(obj)
|
52
|
-
assert_equal SERVICE_API_KEY, obj.serviceApiKey
|
53
|
-
assert_equal CLIENT_ID, obj.clientId
|
54
|
-
assert_equal ID, obj.id
|
55
|
-
assert_equal PASSWORD, obj.password
|
56
|
-
assert_equal CLAIMS, obj.claims
|
57
|
-
assert_equal CLAIMS_LOCALES, obj.claimsLocales
|
58
|
-
assert_equal SNS, obj.sns
|
59
|
-
assert_equal ACCESS_TOKEN, obj.accessToken
|
60
|
-
assert_equal REFRESH_TOKEN, obj.refreshToken
|
61
|
-
assert_equal EXPIRES_IN, obj.expiresIn
|
62
|
-
assert_equal RAW_TOKEN_RESPONSE, obj.rawTokenResponse
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
def generate_hash
|
67
|
-
{
|
68
|
-
serviceApiKey: '<service-api-key>',
|
69
|
-
clientId: 12345,
|
70
|
-
id: '<id>',
|
71
|
-
password: '<password>',
|
72
|
-
claims: [ 'claim0', 'claim1' ],
|
73
|
-
claimsLocales: [ 'en', 'ja' ],
|
74
|
-
sns: 'FACEBOOK',
|
75
|
-
accessToken: '<access-token>',
|
76
|
-
refreshToken: '<refresh-token>',
|
77
|
-
expiresIn: 30000,
|
78
|
-
rawTokenResponse: '<raw-token-response>'
|
79
|
-
}
|
80
|
-
end
|
81
|
-
|
82
|
-
|
83
|
-
def test_setters
|
84
|
-
actual = Authlete::Model::Request::AuthenticationCallbackRequest.new
|
85
|
-
set_params(actual)
|
86
|
-
|
87
|
-
match(actual)
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
def test_to_hash
|
92
|
-
obj = Authlete::Model::Request::AuthenticationCallbackRequest.new
|
93
|
-
set_params(obj)
|
94
|
-
actual = obj.to_hash
|
95
|
-
expected = generate_hash
|
96
|
-
|
97
|
-
assert_equal expected, actual
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
@@ -1,67 +0,0 @@
|
|
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
|
-
require 'authlete'
|
19
|
-
require 'minitest/autorun'
|
20
|
-
|
21
|
-
|
22
|
-
class AuthorizationFailRequestTest < Minitest::Test
|
23
|
-
TICKET = '<ticket>'
|
24
|
-
REASON = 'DENIED'
|
25
|
-
DESCRIPTION = '<description>'
|
26
|
-
|
27
|
-
|
28
|
-
def set_params(obj)
|
29
|
-
obj.ticket = TICKET
|
30
|
-
obj.reason = REASON
|
31
|
-
obj.description = DESCRIPTION
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
def match(obj)
|
36
|
-
assert_equal TICKET, obj.ticket
|
37
|
-
assert_equal REASON, obj.reason
|
38
|
-
assert_equal DESCRIPTION, obj.description
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
def generate_hash
|
43
|
-
{
|
44
|
-
ticket: '<ticket>',
|
45
|
-
reason: 'DENIED',
|
46
|
-
description: '<description>'
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
def test_setters
|
52
|
-
actual = Authlete::Model::Request::AuthorizationFailRequest.new
|
53
|
-
set_params(actual)
|
54
|
-
|
55
|
-
match(actual)
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
def test_to_hash
|
60
|
-
obj = Authlete::Model::Request::AuthorizationFailRequest.new
|
61
|
-
set_params(obj)
|
62
|
-
actual = obj.to_hash
|
63
|
-
expected = generate_hash
|
64
|
-
|
65
|
-
assert_equal expected, actual
|
66
|
-
end
|
67
|
-
end
|