oauth 0.5.14 → 1.1.6

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 (69) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -0
  3. data/CHANGELOG.md +663 -239
  4. data/CITATION.cff +20 -0
  5. data/CODE_OF_CONDUCT.md +79 -29
  6. data/CONTRIBUTING.md +264 -15
  7. data/FUNDING.md +74 -0
  8. data/LICENSE.md +71 -0
  9. data/README.md +642 -297
  10. data/RUBOCOP.md +71 -0
  11. data/SECURITY.md +11 -12
  12. data/certs/pboling.pem +27 -0
  13. data/lib/oauth/auth_sanitizer.rb +36 -0
  14. data/lib/oauth/client/action_controller_request.rb +24 -12
  15. data/lib/oauth/client/em_http.rb +107 -100
  16. data/lib/oauth/client/helper.rb +80 -72
  17. data/lib/oauth/client/net_http.rb +139 -106
  18. data/lib/oauth/client.rb +2 -0
  19. data/lib/oauth/consumer.rb +250 -118
  20. data/lib/oauth/errors/error.rb +2 -0
  21. data/lib/oauth/errors/problem.rb +4 -1
  22. data/lib/oauth/errors/unauthorized.rb +4 -0
  23. data/lib/oauth/errors.rb +2 -0
  24. data/lib/oauth/helper.rb +34 -8
  25. data/lib/oauth/oauth.rb +32 -8
  26. data/lib/oauth/oauth_test_helper.rb +2 -0
  27. data/lib/oauth/optional.rb +20 -0
  28. data/lib/oauth/request_proxy/action_controller_request.rb +14 -31
  29. data/lib/oauth/request_proxy/action_dispatch_request.rb +34 -0
  30. data/lib/oauth/request_proxy/base.rb +42 -31
  31. data/lib/oauth/request_proxy/em_http_request.rb +53 -52
  32. data/lib/oauth/request_proxy/jabber_request.rb +9 -2
  33. data/lib/oauth/request_proxy/mock_request.rb +1 -1
  34. data/lib/oauth/request_proxy/net_http.rb +6 -8
  35. data/lib/oauth/request_proxy/rack_request.rb +0 -4
  36. data/lib/oauth/request_proxy/rest_client_request.rb +6 -4
  37. data/lib/oauth/request_proxy.rb +20 -13
  38. data/lib/oauth/server.rb +14 -6
  39. data/lib/oauth/signature/base.rb +82 -66
  40. data/lib/oauth/signature/hmac/sha1.rb +15 -9
  41. data/lib/oauth/signature/hmac/sha256.rb +15 -9
  42. data/lib/oauth/signature/plaintext.rb +18 -20
  43. data/lib/oauth/signature/rsa/sha1.rb +53 -38
  44. data/lib/oauth/signature.rb +40 -33
  45. data/lib/oauth/token.rb +2 -0
  46. data/lib/oauth/tokens/access_token.rb +3 -1
  47. data/lib/oauth/tokens/consumer_token.rb +10 -6
  48. data/lib/oauth/tokens/request_token.rb +12 -4
  49. data/lib/oauth/tokens/server_token.rb +2 -0
  50. data/lib/oauth/tokens/token.rb +15 -1
  51. data/lib/oauth/version.rb +6 -1
  52. data/lib/oauth.rb +11 -2
  53. data/sig/oauth/consumer.rbs +9 -0
  54. data/sig/oauth/signature/base.rbs +12 -0
  55. data/sig/oauth/tokens/token.rbs +8 -0
  56. data/sig/oauth/version.rbs +6 -0
  57. data.tar.gz.sig +0 -0
  58. metadata +349 -90
  59. metadata.gz.sig +0 -0
  60. data/LICENSE +0 -21
  61. data/TODO +0 -32
  62. data/bin/oauth +0 -11
  63. data/lib/oauth/cli/authorize_command.rb +0 -69
  64. data/lib/oauth/cli/base_command.rb +0 -210
  65. data/lib/oauth/cli/help_command.rb +0 -22
  66. data/lib/oauth/cli/query_command.rb +0 -25
  67. data/lib/oauth/cli/sign_command.rb +0 -78
  68. data/lib/oauth/cli/version_command.rb +0 -7
  69. data/lib/oauth/cli.rb +0 -56
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
4
  # Used on the server for generating tokens
3
5
  class ServerToken < Token
@@ -1,9 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
- # Superclass for the various tokens used by OAuth
4
+ # Superclass for the various tokens used by OAuth.
5
+ #
6
+ # Includes {OAuth::AUTH_SANITIZER::FilteredAttributes} so inspect output redacts the
7
+ # token value and token secret while leaving object identity and non-sensitive
8
+ # fields visible.
3
9
  class Token
4
10
  include OAuth::Helper
11
+ include OAuth::AUTH_SANITIZER::FilteredAttributes
5
12
 
13
+ # Token attributes.
14
+ #
15
+ # @!attribute [rw] token
16
+ # @return [String] OAuth token value (redacted in `#inspect`)
17
+ # @!attribute [rw] secret
18
+ # @return [String] OAuth token secret (redacted in `#inspect`)
6
19
  attr_accessor :token, :secret
20
+ filtered_attributes :token, :secret
7
21
 
8
22
  def initialize(token, secret)
9
23
  @token = token
data/lib/oauth/version.rb CHANGED
@@ -1,3 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
- VERSION = "0.5.14".freeze
4
+ module Version
5
+ VERSION = "1.1.6"
6
+ end
7
+ VERSION = Version::VERSION # Traditional Constant Location
3
8
  end
data/lib/oauth.rb CHANGED
@@ -1,7 +1,12 @@
1
- root = File.dirname(__FILE__)
2
- $LOAD_PATH << root unless $LOAD_PATH.include?(root)
1
+ # frozen_string_literal: true
2
+
3
+ # third party gems
4
+ require "snaky_hash"
5
+ require "version_gem"
6
+ require_relative "oauth/version"
3
7
 
4
8
  require "oauth/version"
9
+ require "oauth/auth_sanitizer"
5
10
 
6
11
  require "oauth/oauth"
7
12
 
@@ -11,3 +16,7 @@ require "oauth/signature/hmac/sha1"
11
16
  require "oauth/signature/hmac/sha256"
12
17
  require "oauth/signature/rsa/sha1"
13
18
  require "oauth/request_proxy/mock_request"
19
+
20
+ OAuth::Version.class_eval do
21
+ extend VersionGem::Basic
22
+ end
@@ -0,0 +1,9 @@
1
+ module OAuth
2
+ class Consumer
3
+ include OAuth::AUTH_SANITIZER::FilteredAttributes
4
+
5
+ attr_accessor options: untyped
6
+ attr_accessor key: untyped
7
+ attr_accessor secret: untyped
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module OAuth
2
+ module Signature
3
+ class Base
4
+ include OAuth::AUTH_SANITIZER::FilteredAttributes
5
+
6
+ attr_accessor options: untyped
7
+ attr_reader token_secret: untyped
8
+ attr_reader consumer_secret: untyped
9
+ attr_reader request: untyped
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module OAuth
2
+ class Token
3
+ include OAuth::AUTH_SANITIZER::FilteredAttributes
4
+
5
+ attr_accessor token: untyped
6
+ attr_accessor secret: untyped
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module OAuth
2
+ module Version
3
+ VERSION: String
4
+ end
5
+ VERSION: String
6
+ end
data.tar.gz.sig ADDED
Binary file