warden_openid_bearer 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f228ea62cd8329a39ec230cb8b764c8b83db2557a767c41f0f18b28f35fabe8c
4
- data.tar.gz: 11272a48dc32c8063f08957d7e409100bfb14818a0795a86acbf9416b88a2b3d
3
+ metadata.gz: 1762ecf69f78605db0e0637a503c41a5b76a05235e0ad227386d919dc0ec1d56
4
+ data.tar.gz: b91459c148bc168db2c523d26558342232df3d59c1ef1b0259285001a87870ff
5
5
  SHA512:
6
- metadata.gz: 0602d2ade77d620f6aab62b0f0c55e02f4ff4d7ceb360d33c875a18b1318ec4b8664f3d0b0fc8a6eee8c423d8674dbfe1b3ad28feb80d2638489f013171a252c
7
- data.tar.gz: dfe6d0e9418db37a762124a8cd94a00ab1127ceef9617acfcbc7bb94683ee92f6f661efde51a570a5b79d0fa21db4f480ac1e868b6ec4250065f73625f419046
6
+ metadata.gz: 636a5c94bd0070680997434e9cfd424b9fa7ac98126b0013b5c5c6fd28d2991ab32c2f8978d776b24e4e2e45d71c1fb61b2e6c5184fcd70f2db1d0c014f1e0fa
7
+ data.tar.gz: 722fb3766472b6045374c9eeeac3d094a5d4ddf2796976b2dcf9a6e581296a2ab5b2cf28e1ea7de724360abc546d30b49dc86815c0f742608e07b2e6e915a021
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [Unreleased]
1
+ ## [0.1.2] - 2022-10-07
2
+ - Fix gemspec dependencies
3
+
4
+ ## [0.1.1] - 2022-10-07
5
+ - Now with documentation
2
6
 
3
7
  ## [0.1.0] - 2022-10-07
4
8
 
data/README.md CHANGED
@@ -1,8 +1,55 @@
1
1
  # WardenOpenidBearer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/warden_openid_bearer`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [Warden](https://github.com/wardencommunity/warden) strategy for authentication with OpenID-Connect JWT bearer tokens.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ This gem is like
6
+ [the `warden_openid_auth gem`](https://rubygems.org/gems/warden_openid_auth),
7
+ except that it only provides support for the very last step of
8
+ the OAuth code flow, i.e. when the resource server / relying party
9
+ (your Ruby Web app) validates and decodes the JWT token.
10
+
11
+ Use this gem if your client-side Web (or mobile) app will be taking
12
+ care of the rest of the OAuth2 motions, such as redirecting (or
13
+ opening a popup window) to the authentication server at login time,
14
+ managing and refreshing tokens, doing all these unspeakable things
15
+ with iframes, etc.
16
+
17
+ ## Usage
18
+
19
+ ### In a Rails application
20
+
21
+
22
+ 1. Add the [`rails_warden` gem](https://rubygems.org/gems/rails_warden) into your application
23
+ 1. Add the following to e.g. `config/initializers/authentication.rb`:
24
+ ```ruby
25
+ Rails.application.config.middleware.use RailsWarden::Manager do |manager|
26
+ manager.default_strategies WardenOpenidBearer::Strategy.register!
27
+ WardenOpenidBearer.configure do |oidc|
28
+ oidc.openid_metadata_url = "https://example.com/.well-known/openid-configuration"
29
+ end
30
+
31
+ manager.failure_app = Proc.new { |_env|
32
+ ['401', {'Content-Type' => 'application/json'}, [{ error: 'Unauthorized' }.to_json]]
33
+ }
34
+ end
35
+ ```
36
+ 1. Access control must be explicitly added to your controllers, e.g.
37
+ ```ruby
38
+ class MyController < ApplicationController
39
+ before_action do
40
+ authenticate!
41
+ end
42
+ end
43
+ ```
44
+
45
+ ### Subclassing
46
+
47
+ Subclassing `WardenOpenidBearer::Strategy` is the recommended way to
48
+ - support more than one authentication server (overriding `metadata_url` and/or `cache_timeout`),
49
+ - provide user hydration into the class of your choice (overriding `user_of_claims`).
50
+
51
+ More details available in the rubydoc comments of
52
+ [`lib/warden_openid_bearer/strategy.rb`](lib/warden_openid_bearer/strategy.rb).
6
53
 
7
54
  ## Installation
8
55
 
@@ -14,10 +61,6 @@ If bundler is not being used to manage dependencies, install the gem by executin
14
61
 
15
62
  $ gem install warden_openid_bearer
16
63
 
17
- ## Usage
18
-
19
- TODO: Write usage instructions here
20
-
21
64
  ## Development
22
65
 
23
66
  After checking out the Git repository, run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the test suite and linter checks. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WardenOpenidBearer
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -42,4 +42,6 @@ Gem::Specification.new do |spec|
42
42
 
43
43
  spec.add_dependency "warden", "~> 1.2.0"
44
44
  spec.add_dependency "dry-configurable", "~> 0.15.0"
45
+ spec.add_dependency "net-http", "~> 0.2.2"
46
+ spec.add_dependency "jwt", "~> 2.5"
45
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden_openid_bearer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominique Quatravaux
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.15.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: net-http
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.2.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.2.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: jwt
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.5'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.5'
41
69
  description: |2+
42
70
 
43
71
  This gem is like the `warden_openid_auth` gem, except that it only