oauth2 2.0.19 → 2.0.21
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +88 -1
- data/CITATION.cff +6 -6
- data/CODE_OF_CONDUCT.md +0 -0
- data/CONTRIBUTING.md +82 -31
- data/FUNDING.md +1 -1
- data/LICENSE.md +110 -0
- data/README.md +245 -675
- data/RUBOCOP.md +0 -0
- data/SECURITY.md +1 -4
- data/certs/pboling.pem +27 -0
- data/lib/oauth2/access_token.rb +0 -0
- data/lib/oauth2/auth_sanitizer.rb +36 -0
- data/lib/oauth2/authenticator.rb +0 -0
- data/lib/oauth2/client.rb +13 -11
- data/lib/oauth2/error.rb +0 -0
- data/lib/oauth2/filtered_attributes.rb +2 -5
- data/lib/oauth2/response.rb +0 -0
- data/lib/oauth2/strategy/assertion.rb +0 -0
- data/lib/oauth2/strategy/auth_code.rb +0 -0
- data/lib/oauth2/strategy/base.rb +0 -0
- data/lib/oauth2/strategy/client_credentials.rb +0 -0
- data/lib/oauth2/strategy/implicit.rb +0 -0
- data/lib/oauth2/strategy/password.rb +0 -0
- data/lib/oauth2/version.rb +2 -1
- data/lib/oauth2.rb +5 -5
- data/sig/oauth2/access_token.rbs +0 -0
- data/sig/oauth2/authenticator.rbs +0 -0
- data/sig/oauth2/client.rbs +0 -0
- data/sig/oauth2/error.rbs +0 -0
- data/sig/oauth2/filtered_attributes.rbs +0 -0
- data/sig/oauth2/response.rbs +0 -0
- data/sig/oauth2/sanitized_logger.rbs +0 -0
- data/sig/oauth2/strategy.rbs +0 -0
- data/sig/oauth2/thing_filter.rbs +0 -0
- data/sig/oauth2/version.rbs +1 -0
- data/sig/oauth2.rbs +0 -0
- data.tar.gz.sig +0 -0
- metadata +110 -111
- metadata.gz.sig +3 -2
- data/IRP.md +0 -107
- data/LICENSE.txt +0 -22
- data/OIDC.md +0 -167
- data/REEK +0 -2
- data/THREAT_MODEL.md +0 -94
data/RUBOCOP.md
CHANGED
|
File without changes
|
data/SECURITY.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Supported |
|
|
6
6
|
|----------|-----------|
|
|
7
|
-
|
|
|
7
|
+
| 2.0.latest | ✅ |
|
|
8
8
|
|
|
9
9
|
## Security contact information
|
|
10
10
|
|
|
@@ -12,8 +12,6 @@ To report a security vulnerability, please use the
|
|
|
12
12
|
[Tidelift security contact](https://tidelift.com/security).
|
|
13
13
|
Tidelift will coordinate the fix and disclosure.
|
|
14
14
|
|
|
15
|
-
More detailed explanation of the process is in [IRP.md][IRP].
|
|
16
|
-
|
|
17
15
|
## Additional Support
|
|
18
16
|
|
|
19
17
|
If you are interested in support for versions older than the latest release,
|
|
@@ -21,4 +19,3 @@ please consider sponsoring the project / maintainer @ https://liberapay.com/pbol
|
|
|
21
19
|
or find other sponsorship links in the [README].
|
|
22
20
|
|
|
23
21
|
[README]: README.md
|
|
24
|
-
[IRP]: IRP.md
|
data/certs/pboling.pem
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
|
|
3
|
+
ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
|
|
4
|
+
A2NvbTAeFw0yNTA1MDQxNTMzMDlaFw00NTA0MjkxNTMzMDlaMEMxFTATBgNVBAMM
|
|
5
|
+
DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
|
|
6
|
+
LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAruUoo0WA
|
|
7
|
+
uoNuq6puKWYeRYiZekz/nsDeK5x/0IEirzcCEvaHr3Bmz7rjo1I6On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4EFVdb/IrW/0k
|
|
22
|
+
kNSfjtAfBHO8nLGuqQZVH9IBD1i9K6aSs7pT6TW8itXUIlkIUI2tg5YzW6OFfPzq
|
|
23
|
+
QekSkX3lZfY+HTSp/o+YvKkqWLUV7PQ7xh1ZYDtocpaHwgxe/j3bBqHE+CUPH2vA
|
|
24
|
+
0V/FwdTRWcwsjVoOJTrYcff8pBZ8r2MvtAc54xfnnhGFzeRHfcltobgFxkAXdE6p
|
|
25
|
+
DVjBtqT23eugOqQ73umLcYDZkc36vnqGxUBSsXrzY9pzV5gGr2I8YUxMqf6ATrZt
|
|
26
|
+
L9nRqA==
|
|
27
|
+
-----END CERTIFICATE-----
|
data/lib/oauth2/access_token.rb
CHANGED
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OAuth2
|
|
4
|
+
AUTH_SANITIZER = begin
|
|
5
|
+
auth_sanitizer_requirement = Gem::Requirement.new("~> 0.2", ">= 0.2.1")
|
|
6
|
+
auth_sanitizer_spec = Gem.loaded_specs["auth-sanitizer"]
|
|
7
|
+
unless auth_sanitizer_spec && auth_sanitizer_requirement.satisfied_by?(auth_sanitizer_spec.version)
|
|
8
|
+
# :nocov:
|
|
9
|
+
auth_sanitizer_spec = Gem::Specification.find_by_name("auth-sanitizer", auth_sanitizer_requirement)
|
|
10
|
+
# :nocov:
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
auth_sanitizer_loader_path = File.join(
|
|
14
|
+
auth_sanitizer_spec.full_gem_path,
|
|
15
|
+
"lib/auth_sanitizer/loader.rb"
|
|
16
|
+
)
|
|
17
|
+
unless File.file?(auth_sanitizer_loader_path)
|
|
18
|
+
# :nocov:
|
|
19
|
+
raise LoadError, "oauth2 requires auth-sanitizer #{auth_sanitizer_requirement}; " \
|
|
20
|
+
"loader not found at #{auth_sanitizer_loader_path}"
|
|
21
|
+
# :nocov:
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
auth_sanitizer_loader_namespace = Module.new
|
|
25
|
+
auth_sanitizer_loader_namespace.module_eval(
|
|
26
|
+
File.read(auth_sanitizer_loader_path),
|
|
27
|
+
auth_sanitizer_loader_path,
|
|
28
|
+
1
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
auth_sanitizer_loader_namespace.
|
|
32
|
+
const_get(:AuthSanitizer).
|
|
33
|
+
const_get(:Loader).
|
|
34
|
+
load_isolated
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/oauth2/authenticator.rb
CHANGED
|
File without changes
|
data/lib/oauth2/client.rb
CHANGED
|
@@ -42,7 +42,7 @@ module OAuth2
|
|
|
42
42
|
# @option options [Hash] :connection_opts ({}) Hash of connection options to pass to initialize Faraday
|
|
43
43
|
# @option options [Boolean] :raise_errors (true) whether to raise an OAuth2::Error on responses with 400+ status codes
|
|
44
44
|
# @option options [Integer] :max_redirects (5) maximum number of redirects to follow
|
|
45
|
-
# @option options [Logger] :logger (::Logger.new($stdout)) Logger instance for HTTP request/response output; requires OAUTH_DEBUG to be true. When debug logging is enabled, sensitive values are filtered using {
|
|
45
|
+
# @option options [Logger] :logger (::Logger.new($stdout)) Logger instance for HTTP request/response output; requires OAUTH_DEBUG to be true. When debug logging is enabled, sensitive values are filtered using {OAuth2::AUTH_SANITIZER::SanitizedLogger} initialized from `OAuth2.config[:filtered_label]` and the key names in `OAuth2.config[:filtered_debug_keys]`.
|
|
46
46
|
# @option options [Class] :access_token_class (AccessToken) class to use for access tokens; you can subclass OAuth2::AccessToken, @version 2.0+
|
|
47
47
|
# @option options [Hash] :ssl SSL options for Faraday
|
|
48
48
|
#
|
|
@@ -446,7 +446,7 @@ module OAuth2
|
|
|
446
446
|
# See: Hash#partition https://bugs.ruby-lang.org/issues/16252
|
|
447
447
|
req_opts, oauth_opts = opts.
|
|
448
448
|
partition { |k, _v| RESERVED_REQ_KEYS.include?(k.to_s) }.
|
|
449
|
-
map
|
|
449
|
+
map(&:to_h)
|
|
450
450
|
|
|
451
451
|
begin
|
|
452
452
|
response = connection.run_request(verb, url, req_opts[:body], req_opts[:headers]) do |req|
|
|
@@ -563,15 +563,17 @@ module OAuth2
|
|
|
563
563
|
end
|
|
564
564
|
|
|
565
565
|
def oauth_debug_logging(builder)
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
566
|
+
if OAuth2::OAUTH_DEBUG
|
|
567
|
+
builder.response(
|
|
568
|
+
:logger,
|
|
569
|
+
OAuth2::AUTH_SANITIZER::SanitizedLogger.new(
|
|
570
|
+
options[:logger],
|
|
571
|
+
filtered_keys: OAuth2.config[:filtered_debug_keys],
|
|
572
|
+
label: OAuth2.config[:filtered_label]
|
|
573
|
+
),
|
|
574
|
+
bodies: true
|
|
575
|
+
)
|
|
576
|
+
end
|
|
575
577
|
end
|
|
576
578
|
end
|
|
577
579
|
end
|
data/lib/oauth2/error.rb
CHANGED
|
File without changes
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module OAuth2
|
|
4
|
-
# Permanent alias for {
|
|
4
|
+
# Permanent alias for {OAuth2::AUTH_SANITIZER::FilteredAttributes}.
|
|
5
5
|
#
|
|
6
6
|
# This constant is intentionally kept in the `OAuth2` namespace because it
|
|
7
7
|
# was part of the public API before the implementation was extracted into the
|
|
8
8
|
# `auth-sanitizer` gem. It will **not** be deprecated or removed.
|
|
9
|
-
|
|
10
|
-
# New code that does not need the `OAuth2::` namespace can use
|
|
11
|
-
# {Auth::Sanitizer::FilteredAttributes} directly.
|
|
12
|
-
FilteredAttributes = Auth::Sanitizer::FilteredAttributes
|
|
9
|
+
FilteredAttributes = OAuth2::AUTH_SANITIZER::FilteredAttributes
|
|
13
10
|
end
|
data/lib/oauth2/response.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/oauth2/strategy/base.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/oauth2/version.rb
CHANGED
data/lib/oauth2.rb
CHANGED
|
@@ -5,12 +5,12 @@ require "cgi/escape"
|
|
|
5
5
|
require "time"
|
|
6
6
|
|
|
7
7
|
# third party gems
|
|
8
|
-
require "auth/sanitizer"
|
|
9
8
|
require "snaky_hash"
|
|
10
9
|
require "version_gem"
|
|
11
10
|
|
|
12
11
|
# includes gem files
|
|
13
12
|
require_relative "oauth2/version"
|
|
13
|
+
require_relative "oauth2/auth_sanitizer"
|
|
14
14
|
require_relative "oauth2/filtered_attributes"
|
|
15
15
|
require_relative "oauth2/error"
|
|
16
16
|
require_relative "oauth2/authenticator"
|
|
@@ -67,7 +67,7 @@ module OAuth2
|
|
|
67
67
|
assertion
|
|
68
68
|
code_verifier
|
|
69
69
|
token
|
|
70
|
-
]
|
|
70
|
+
]
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
# The current runtime configuration for the library.
|
|
@@ -92,10 +92,10 @@ module OAuth2
|
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
# Wire
|
|
96
|
-
# FilteredAttributes-bearing objects and
|
|
95
|
+
# Wire OAuth2::AUTH_SANITIZER's label provider to read from OAuth2.config so that
|
|
96
|
+
# FilteredAttributes-bearing objects and OAuth2::AUTH_SANITIZER::SanitizedLogger instances
|
|
97
97
|
# pick up OAuth2.config[:filtered_label] at their initialization time.
|
|
98
|
-
|
|
98
|
+
OAuth2::AUTH_SANITIZER.filtered_label_provider = -> { OAuth2.config[:filtered_label] }
|
|
99
99
|
|
|
100
100
|
# Extend OAuth2::Version with VersionGem helpers to provide semantic version helpers.
|
|
101
101
|
OAuth2::Version.class_eval do
|
data/sig/oauth2/access_token.rbs
CHANGED
|
File without changes
|
|
File without changes
|
data/sig/oauth2/client.rbs
CHANGED
|
File without changes
|
data/sig/oauth2/error.rbs
CHANGED
|
File without changes
|
|
File without changes
|
data/sig/oauth2/response.rbs
CHANGED
|
File without changes
|
|
File without changes
|
data/sig/oauth2/strategy.rbs
CHANGED
|
File without changes
|
data/sig/oauth2/thing_filter.rbs
CHANGED
|
File without changes
|
data/sig/oauth2/version.rbs
CHANGED
data/sig/oauth2.rbs
CHANGED
|
File without changes
|
data.tar.gz.sig
CHANGED
|
Binary file
|