Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ inherit_gem:
rubocop-lts: rubocop-lts.yml

require:
- 'rubocop-faker'
- 'rubocop-md'
- 'rubocop-minitest'
- 'rubocop-packaging'
Expand Down
37 changes: 9 additions & 28 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-08-23 11:43:55 UTC using RuboCop version 1.30.1.
# on 2022-08-23 21:37:33 UTC using RuboCop version 1.30.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -18,12 +18,12 @@ Lint/UnderscorePrefixedVariableName:
Exclude:
- 'lib/oauth/consumer.rb'

# Offense count: 47
# Offense count: 38
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 62

# Offense count: 9
# Offense count: 8
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 302
Expand All @@ -33,7 +33,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 18

# Offense count: 75
# Offense count: 66
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 43
Expand All @@ -52,47 +52,28 @@ Metrics/PerceivedComplexity:
Minitest/MultipleAssertions:
Max: 18

# Offense count: 2
Naming/AccessorMethodName:
Exclude:
- 'lib/oauth/cli/authorize_command.rb'

# Offense count: 2
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Exclude:
- 'lib/oauth/cli/help_command.rb'
- 'lib/oauth/cli/sign_command.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/oauth/client/em_http.rb'

# Offense count: 1
Security/Open:
Exclude:
- 'lib/oauth/cli/base_command.rb'

# Offense count: 2
Style/ClassVars:
Exclude:
- 'lib/oauth/consumer.rb'
- 'lib/oauth/server.rb'

# Offense count: 67
# Offense count: 60
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

# Offense count: 3
# Offense count: 2
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'lib/oauth/cli/sign_command.rb'
- 'lib/oauth/consumer.rb'
- 'lib/oauth/signature/base.rb'

Expand All @@ -103,7 +84,7 @@ Style/IfUnlessModifier:
- 'bin/bundle'
- 'lib/oauth/request_proxy/net_http.rb'

# Offense count: 1
# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
Expand All @@ -123,11 +104,11 @@ ThreadSafety/InstanceVariableInClassMethod:
- 'lib/oauth/signature.rb'
- 'lib/oauth/signature/base.rb'

# Offense count: 77
# Offense count: 76
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
# AllowedPatterns: (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#)
# AllowedPatterns: (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#), (?-mix:^\#)
# IgnoredPatterns: (?-mix:^\#)
Layout/LineLength:
Max: 429
2 changes: 1 addition & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if RUN_COVERAGE
formatter SimpleCov::Formatter::HTMLFormatter
end

minimum_coverage(66)
minimum_coverage(65)
end
else
puts "Not running coverage on #{RUBY_ENGINE} #{RUBY_VERSION}"
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [1.1.0] 2022-08-26
### Changed
* `OAuth::CLI` has been extracted to a new gem, `oauth-tty`, hosted on [Gitlab](https://gitlab.com/oauth-xx/oauth-tty)
* The public API of `oauth-tty` is backwards compatible (meaning `OAuth::CLI`)
* The change within the `oauth` gem is backwards compatible as `oauth-tty` has been added as a dependency
* Minor version bump is cautionary, as many lines of code have changed.

## [1.0.0] 2022-08-23
### Changed
* Dropped support for Ruby < 2.7
Expand Down Expand Up @@ -440,7 +447,8 @@ but please have a look at the unit tests.
* Moved all non-Rails functionality from the Rails plugin:
http://code.google.com/p/oauth-plugin/

[Unreleased]: https://github.com/oauth-xx/oauth-ruby/compare/v1.0.0...main
[Unreleased]: https://github.com/oauth-xx/oauth-ruby/compare/v1.1.0...main
[1.1.0]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v1.1.0
[1.0.0]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v1.0.0
[0.6.1]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.6.1
[0.6.0]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.6.0
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ To submit a patch, please fork the project and create a patch with
tests. Once you're happy with it send a pull request and post a message to the
[google group][mailinglist].

## Run tests

### Against Rails 6

```bash
BUNDLE_GEMFILE=gemfiles/a6.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/a6.gemfile bundle exec rake
```


### Against Rails 7

```bash
BUNDLE_GEMFILE=gemfiles/a7.gemfile bundle install
BUNDLE_GEMFILE=gemfiles/a7.gemfile bundle exec rake
```

## Contributors

[![Contributors](https://contrib.rocks/image?repo=oauth-xx/oauth-ruby)][contributors]
Expand Down
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ gem "pry", platforms: %i[mri]
platforms :mri do
gem "codecov", "~> 0.6" # For CodeCov
gem "overcommit", "~> 0.58"
gem "rubocop-faker"
gem "rubocop-md"
gem "rubocop-minitest"
gem "rubocop-packaging"
Expand All @@ -27,8 +26,8 @@ platforms :mri do

# Add `byebug` to your code where you want to drop to REPL, and add DEBUG=true when running tests
gem "byebug"
# WebMock is known to work with Curb >= 0.7.16, < 0.10, except versions 0.8.7
gem "curb", [">= 0.7.16", "< 0.10", "!= 0.8.7"] if curb
# WebMock is known to work with Curb >= 0.7.16, < 1.1, except versions 0.8.7
gem "curb", [">= 0.7.16", "< 1.1", "!= 0.8.7"] if curb
gem "pry-byebug"
end

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ See the sibling `oauth2` gem for OAuth 2.0 implementations in Ruby.

**New EOL Policy**

Versions 1.0.x will be EOL no later than April, 2025.
Versions 1.x will be EOL no later than April, 2025.
Versions 0.6.x will be EOL no later than April, 2024.
Versions 0.5.x will be EOL no later than April, 2023.

This will facilitate dropping support for old, dead, and crusty versions of Ruby.

Non-commercial support for the oldest version of Ruby (which itself is going EOL) will be dropped each year in April.

Please upgrade to version 1.0. The only breaking change in 1.0 is dropping old Rubies.
Please upgrade to version 1.1. The only breaking change in 1.x is dropping old Rubies.

## Status

Expand Down Expand Up @@ -191,7 +191,7 @@ Targeted ruby compatibility is non-EOL versions of Ruby, currently 2.7, 3.0, and
3.1. Ruby is limited to 2.7+ in the gemspec, and this will change with minor version bumps,
while the gem is still in 0.x, in accordance with the SemVer spec.

The `main` branch now targets 1.0.x releases, for Ruby >= 2.7.
The `main` branch now targets 1.x releases, for Ruby >= 2.7.
See `v0.6-maintenance` (EOL April, 2024) branch for Ruby >= 2.4.
See `v0.5-maintenance` (EOL April, 2023) branch for Ruby >= 2.0.

Expand Down Expand Up @@ -248,7 +248,11 @@ gem. After extraction that gem was made to depend on this gem.

Unfortunately, this gem does have some Rails related bits that are
**optional** to load. You don't need Rails! The Rails bits may be pulled out
into a separate gem with the release of version 1.0 of this gem.
into a separate gem with the 1.x minor updates of this gem.

## Extensions

* [oauth-tty (on Gitlab)](https://gitlab.com/oauth-xx/oauth-tty) ([rubygems.org](https://rubygems.org/gems/oauth-tty))

## Usage

Expand Down Expand Up @@ -335,7 +339,7 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
For example:

```ruby
spec.add_dependency "oauth", "~> 1.0"
spec.add_dependency "oauth", "~> 1.1"
```

## License
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Version | Supported | EOL |
|---------|--------------------|---------|
| 1.1.x | :white_check_mark: | 04/2025 |
| 1.0.x | :white_check_mark: | 04/2025 |
| 0.6.x | :white_check_mark: | 04/2024 |
| 0.5.x | :white_check_mark: | 04/2023 |
Expand Down
15 changes: 0 additions & 15 deletions bin/oauth

This file was deleted.

58 changes: 0 additions & 58 deletions lib/oauth/cli.rb

This file was deleted.

73 changes: 0 additions & 73 deletions lib/oauth/cli/authorize_command.rb

This file was deleted.

Loading