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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1762ecf69f78605db0e0637a503c41a5b76a05235e0ad227386d919dc0ec1d56
4
- data.tar.gz: b91459c148bc168db2c523d26558342232df3d59c1ef1b0259285001a87870ff
3
+ metadata.gz: 0775412bb8b81fb2caf0435f670021a0a65af25512364fd072afb68b9caa2aac
4
+ data.tar.gz: 451d23f7debbb38ce46d024555f327a79ae7f13bc0e5b98dc47e2c63b402d6be
5
5
  SHA512:
6
- metadata.gz: 636a5c94bd0070680997434e9cfd424b9fa7ac98126b0013b5c5c6fd28d2991ab32c2f8978d776b24e4e2e45d71c1fb61b2e6c5184fcd70f2db1d0c014f1e0fa
7
- data.tar.gz: 722fb3766472b6045374c9eeeac3d094a5d4ddf2796976b2dcf9a6e581296a2ab5b2cf28e1ea7de724360abc546d30b49dc86815c0f742608e07b2e6e915a021
6
+ metadata.gz: 76d650b1652813f9f0a8d83308a1caacacaa47958c1a3b721b7defc134cb9f8d512ebd0e0d016e29eabe3f230e0f11de17788bef993b28d8982c84ee2a4444c0
7
+ data.tar.gz: 281d78bb3196f616dc2fe894a14f953e8b75577f69405b3a66f73cde5c8d0b15202321fc73c41ccda410643f4ba17f747e0ca5b84bd3118b38ab6d30f96bbee7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.1.4] - 2022-10-11
2
+ - Clean up a stray `puts` left when debugging
3
+
4
+ ## [0.1.3] - 2022-10-07
5
+ - Fix `require`s
6
+
1
7
  ## [0.1.2] - 2022-10-07
2
8
  - Fix gemspec dependencies
3
9
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WardenOpenidBearer
2
4
  # We don't need an overengineered approach based on the Rails cache.
3
5
  # No, really.
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+
1
5
  module WardenOpenidBearer
2
6
  # Cacheable configuration (periodically re-)fetched starting from
3
7
  # the OpenID authentication server's “well-known” endpoint
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "warden"
2
4
 
3
5
  module WardenOpenidBearer
@@ -1,21 +1,25 @@
1
- # Like `WardenOpenidAuth::Strategy` in
2
- # `lib/warden_openid_auth/strategy.rb` from the `warden_openid_auth`
3
- # gem, except done right for a modern, split-backend Web application
4
- # (in which the browser takes charge of the OAuth2 login dance, and
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WardenOpenidBearer
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  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.2
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-07 00:00:00.000000000 Z
11
+ date: 2022-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: warden