Skip to content

Commit

Permalink
🔖 Prepare for release v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Sep 25, 2024
1 parent f7bc482 commit 8bca163
Show file tree
Hide file tree
Showing 14 changed files with 426 additions and 415 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to

# Internal Debugging Controls
export DEBUG=false # do not allow byebug statements (override in .env.local)
export REQUIRE_BENCH=false # set to true in .env.local to turn on require_bench

# .env would override anything in this file, if `dotenv` is uncommented below.
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
Expand Down
4 changes: 3 additions & 1 deletion .simplecov
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "kettle/soup/cover/config"

SimpleCov.start
SimpleCov.start do
add_filter "test/**/*"
end
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Removed

## 2.0.2 - 2024-09-20
## 2.0.2 - 2024-09-25
- COVERAGE: 97.72% -- 214/219 lines in 4 files
- BRANCH COVERAGE: 86.00% -- 43/50 branches in 4 files
- 39.13% documented
### Added
- Improved integration with direnv for development
- Better test coverage
- More tests
- rots v1.0.0 for tests
### Changed
- Upgraded to ruby-openid2 v3.1.0
- Moved to oauth-xx organization

## 2.0.1 - 2024-09-05
### Added
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ platform :mri do
# Debugging
gem "byebug", ">= 11"
end

gem "rots", github: "oauth-xx/rots"
63 changes: 39 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
GIT
remote: https://github.com/oauth-xx/rots
revision: caeacbf72b3b5966c3a299391911557d5771ceee
specs:
rots (0.2.2)
net-http
rack (>= 2.0)
ruby-openid2 (~> 3.0)
yaml

PATH
remote: .
specs:
rack-openid2 (2.0.1)
rack-openid2 (2.0.2)
rack (>= 2.2)
ruby-openid2 (~> 3.0, >= 3.0.1)
ruby-openid2 (~> 3.1, >= 3.1.0)
version_gem (~> 1.1, >= 1.1.4)

GEM
Expand All @@ -23,6 +13,7 @@ GEM
ast (2.4.2)
backports (3.25.0)
byebug (11.1.3)
date (3.3.4)
diff-lcs (1.5.1)
diffy (3.4.2)
docile (1.4.1)
Expand All @@ -38,32 +29,54 @@ GEM
version_gem (~> 1.1, >= 1.1.4)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.1)
minitest (5.25.1)
minitest-focus (1.4.0)
minitest (>= 4, < 6)
minitest-rg (5.3.0)
minitest (~> 5.0)
net-http (0.4.1)
uri
openssl (3.2.0)
optparse (0.5.0)
ostruct (0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
racc (1.8.1)
rack (3.1.7)
rack-session (2.0.0)
rack (>= 3.0.0)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
require_bench (1.0.4)
version_gem (>= 1.1.3, < 4)
rexml (3.3.7)
rots (1.0.0)
date
openssl
optparse
psych (~> 5.1)
rack (>= 2)
rackup (>= 2)
ruby-openid2 (~> 3.1, >= 3.1.0)
stringio
version_gem (~> 1.1, >= 1.1.4)
webrick
yaml (~> 0.3)
rspec-block_is_expected (1.0.6)
rubocop (1.64.1)
rubocop (1.65.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
Expand Down Expand Up @@ -104,9 +117,7 @@ GEM
rubocop (~> 1.51)
rubocop-thread_safety (0.5.1)
rubocop (>= 0.90.0)
ruby-openid2 (3.0.1)
net-http (~> 0.4, >= 0.4.1)
rexml (~> 3.3, >= 3.3.7)
ruby-openid2 (3.1.0)
version_gem (~> 1.1, >= 1.1.4)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
Expand All @@ -125,10 +136,10 @@ GEM
simplecov-rcov (0.3.7)
simplecov (>= 0.4.1)
simplecov_json_formatter (0.1.4)
standard (1.37.0)
standard (1.40.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.64.0)
rubocop (~> 1.65.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
Expand All @@ -143,11 +154,12 @@ GEM
standard-custom (>= 1.0.2, < 2)
standard-performance (>= 1.3.1, < 2)
version_gem (>= 1.1.4, < 3)
stringio (3.1.1)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
uri (0.13.1)
version_gem (1.1.4)
webrick (1.8.2)
yaml (0.3.0)
yard (0.9.37)
yard-junk (0.0.10)
Expand All @@ -162,12 +174,15 @@ PLATFORMS
DEPENDENCIES
byebug (>= 11)
kettle-soup-cover (~> 1.0, >= 1.0.2)
minitest (>= 5)
logger (~> 1.6, >= 1.6.1)
minitest (>= 5, < 6)
minitest-focus (~> 1.4)
minitest-rg (>= 5)
rack-openid2!
rack-session (>= 2)
rake (>= 13)
rots!
require_bench (~> 1.0, >= 1.0.4)
rots (~> 1.0)
rubocop-lts (~> 18.2, >= 18.2.1)
rubocop-minitest (~> 0.36)
rubocop-packaging (~> 0.5, >= 0.5.2)
Expand Down
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<div id="badges">

[![Version](https://img.shields.io/gem/v/rack-openid2.svg)](https://rubygems.org/gems/rack-openid2)
[![Downloads Today](https://img.shields.io/gem/rd/rack-openid2.svg)](https://github.com/oauth-xx/rack-openid2)
[![CI Supported Build][🚎s-wfi]][🚎s-wf]
[![CI Unsupported Build][🚎us-wfi]][🚎us-wf]
[![CI Style Build][🚎st-wfi]][🚎st-wf]
Expand All @@ -19,10 +21,46 @@
[🚎hd-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml
[🚎hd-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml/badge.svg

-----

<div align="center">

[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
[![Polar Shield][🖇polar-img]][🖇polar]
[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]

[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
[⛳liberapay]: https://liberapay.com/pboling/donate
[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
[🖇sponsor]: https://github.com/sponsors/pboling
[🖇polar-img]: https://polar.sh/embed/seeks-funding-shield.svg?org=pboling
[🖇polar]: https://polar.sh/pboling
[🖇kofi-img]: https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg
[🖇kofi]: https://ko-fi.com/O5O86SNP4
[🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
[🖇patreon]: https://patreon.com/galtzo

<span class="badge-buymealatte">
<a href="https://www.buymeacoffee.com/pboling"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
</span>

</div>
</div>

Provides a more HTTPish API around the ruby-openid library.

## Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add rack-openid2

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install rack-openid2

## Usage

You trigger an OpenID request similar to HTTP authentication. From your app, return a "401 Unauthorized" and a "WWW-Authenticate" header with the identifier you would like to validate.
Expand Down Expand Up @@ -94,6 +132,36 @@ __END__
</form>
```

## General Info

| Primary Namespace | `Rack::OpenID` |
|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| gem name | [ruby-openid2](https://rubygems.org/gems/rack-openid2) |
| code triage | [![Open Source Helpers](https://www.codetriage.com/oauth-xx/rack-openid2/badges/users.svg)](https://www.codetriage.com/oauth-xx/rack-openid2) |
| documentation | [on Github.com][homepage], [on Rdoc.info][documentation] |
| expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
| `...` 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] |

<!-- 7️⃣ spread 💖 -->
[🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo
[🐦tweet]: http://twitter.com/galtzo
[🚎blog]: http://www.railsbling.com/tags/rack-openid2/
[🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
[🖇linkedin]: http://www.linkedin.com/in/peterboling
[🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-blue?style=plastic&logo=linkedin
[✌️wellfound]: https://angel.co/u/peter-boling
[✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=plastic&logo=wellfound
[💲crunchbase]: https://www.crunchbase.com/person/peter-boling
[💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=plastic&logo=crunchbase
[🐘ruby-mast]: https://ruby.social/@galtzo
[🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo
[🌳linktree]: https://linktr.ee/galtzo
[🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree

<!-- Maintainer Contact Links -->
[aboutme]: https://about.me/peter.boling
[coderme]: https://coderwall.com/Peter%20Boling

## TODO

- 1 failing test (skipped)
Expand Down
7 changes: 3 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ require "bundler/gem_tasks"

require "rake/testtask"

require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp?("true")

desc "Run tests"
Rake::TestTask.new("test") do |t|
t.libs << "lib"
t.libs << "test"
t.test_files = FileList["test/**/test_*.rb"]
t.verbose = false
end

Expand Down Expand Up @@ -40,4 +39,4 @@ rescue LoadError
end
end

task default: %i[test rubocop_gradual yard yard:junk]
task default: %i[test rubocop_gradual:autocorrect yard yard:junk]
2 changes: 1 addition & 1 deletion lib/rack/openid/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Rack
class OpenID
module Version
VERSION = "2.0.1"
VERSION = "2.0.2"
end
end
end
12 changes: 10 additions & 2 deletions rack-openid2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,26 @@ Gem::Specification.new do |spec|
spec.metadata["rubygems_mfa_required"] = "true"

spec.add_dependency("rack", ">= 2.2")
spec.add_dependency("ruby-openid2", "~> 3.0", ">= 3.0.1")
spec.add_dependency("ruby-openid2", "~> 3.1", ">= 3.1.0")
spec.add_dependency("version_gem", "~> 1.1", ">= 1.1.4")

# Testing
spec.add_development_dependency("minitest", ">= 5")
spec.add_development_dependency("minitest", ">= 5", "< 6") # Use assert_nil if expecting nil
spec.add_development_dependency("minitest-focus", "~> 1.4")
spec.add_development_dependency("minitest-rg", ">= 5")
spec.add_development_dependency("rack-session", ">= 2")
spec.add_development_dependency("rake", ">= 13")
spec.add_development_dependency("rots", "~> 1.0")

# Test Logging
spec.add_development_dependency("logger", "~> 1.6", ">= 1.6.1")

# Coverage
spec.add_development_dependency("kettle-soup-cover", "~> 1.0", ">= 1.0.2")

# Debugging
spec.add_development_dependency("require_bench", "~> 1.0", ">= 1.0.4")

# Linting
spec.add_development_dependency("rubocop-lts", "~> 18.2", ">= 18.2.1")
spec.add_development_dependency("rubocop-minitest", "~> 0.36")
Expand Down
20 changes: 15 additions & 5 deletions test/test_helper.rb → test/support/config.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# External dependencies
require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp?("true")
require "byebug" if ENV.fetch("DEBUG", "false").casecmp?("true")
require "net/http"
require "rack"
require "rack/session"

# testing libraries
# External testing libraries
require "minitest/rg"

# Test support
require "support/logging"
require_relative "logging"

## Last thing before loading this gem is to setup code coverage
begin
Expand All @@ -22,9 +23,18 @@

# Testing libraries that need to load after simplecov
require "minitest/autorun"
require "minitest/focus"

# Internal dependencies & mixins
require "rack/openid"
require "rack/openid/simple_auth"
# rots depends on this library, but the tests here also depend on it,
# so it needs to load after simplecov, in order to get accurate coverage of this gem,
# since this gem is loaded by rots.
require "rots"
require "rots/mocks"
require "rots/test"

OpenID::Util.logger = TestLogging::LOGGER
OpenID.fetcher = Rots::Mocks::Fetcher.new(Rots::Mocks::RotsServer.new)

# This library
require "rack-openid2"
require "rack/openid/simple_auth"
Loading

0 comments on commit 8bca163

Please sign in to comment.