warden_openid_bearer 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/warden_openid_bearer/cache_mixin.rb +2 -0
- data/lib/warden_openid_bearer/discovered_config.rb +4 -0
- data/lib/warden_openid_bearer/registerer.rb +2 -0
- data/lib/warden_openid_bearer/strategy.rb +21 -18
- data/lib/warden_openid_bearer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0775412bb8b81fb2caf0435f670021a0a65af25512364fd072afb68b9caa2aac
|
4
|
+
data.tar.gz: 451d23f7debbb38ce46d024555f327a79ae7f13bc0e5b98dc47e2c63b402d6be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76d650b1652813f9f0a8d83308a1caacacaa47958c1a3b721b7defc134cb9f8d512ebd0e0d016e29eabe3f230e0f11de17788bef993b28d8982c84ee2a4444c0
|
7
|
+
data.tar.gz: 281d78bb3196f616dc2fe894a14f953e8b75577f69405b3a66f73cde5c8d0b15202321fc73c41ccda410643f4ba17f747e0ca5b84bd3118b38ab6d30f96bbee7
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,25 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
# the back-end only checks signatures on the JWT claims).
|
6
|
-
#
|
7
|
-
# You shoud subclass `WardenOpenidBearer::Strategy` and override the
|
8
|
-
# `user_of_claims` protected method if you want `env['warden'].user`
|
9
|
-
# to be a “real” user object (instead of just a hash of OIDC claims,
|
10
|
-
# which is what happens when using `WardenOpenidBearer::Strategy` directly).
|
11
|
-
# If you want your Rails app to support more than one OIDC
|
12
|
-
# authentication server, you should also subclass
|
13
|
-
# `WardenOpenidBearer::Strategy` and override the `metadata_url` method.
|
14
|
-
#
|
15
|
-
# This class has a `self.register!` method, which makes things
|
16
|
-
# (slightly) easier than calling `Warden::Strategies.add` yourself.
|
17
|
-
# See `WardenOpenidBearer::Registerer` for details.
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "jwt"
|
4
|
+
|
18
5
|
module WardenOpenidBearer
|
6
|
+
# Like `WardenOpenidAuth::Strategy` in
|
7
|
+
# `lib/warden_openid_auth/strategy.rb` from the `warden_openid_auth`
|
8
|
+
# gem, except done right for a modern, split-backend Web application
|
9
|
+
# (in which the browser takes charge of the OAuth2 login dance, and
|
10
|
+
# the back-end only checks signatures on the JWT claims).
|
11
|
+
#
|
12
|
+
# You shoud subclass `WardenOpenidBearer::Strategy` and override the
|
13
|
+
# `user_of_claims` protected method if you want `env['warden'].user`
|
14
|
+
# to be a “real” user object (instead of just a hash of OIDC claims,
|
15
|
+
# which is what happens when using `WardenOpenidBearer::Strategy` directly).
|
16
|
+
# If you want your Rails app to support more than one OIDC
|
17
|
+
# authentication server, you should also subclass
|
18
|
+
# `WardenOpenidBearer::Strategy` and override the `metadata_url` method.
|
19
|
+
#
|
20
|
+
# This class has a `self.register!` method, which makes things
|
21
|
+
# (slightly) easier than calling `Warden::Strategies.add` yourself.
|
22
|
+
# See `WardenOpenidBearer::Registerer` for details.
|
19
23
|
class Strategy < Warden::Strategies::Base
|
20
24
|
include WardenOpenidBearer::Registerer # Provides self.register!
|
21
25
|
include WardenOpenidBearer::CacheMixin
|
@@ -98,7 +102,6 @@ module WardenOpenidBearer
|
|
98
102
|
# this class and re-uses it across requests (see
|
99
103
|
# `_fetch_strategy` in `lib/warden/proxy.rb`).
|
100
104
|
cached_by(request) do
|
101
|
-
puts request.headers
|
102
105
|
strategy, token = (request.headers["Authorization"] || "").split(" ")
|
103
106
|
token if (strategy || "").downcase == "bearer"
|
104
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden_openid_bearer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominique Quatravaux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: warden
|