usps-support 0.2.46 → 0.2.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1508e9abf6ef884c05e7201b52f3c328a81be47388319938e5a4b3ef8aa5e5a
4
- data.tar.gz: '08de17c41c0489f4f0a6994a73ca193a25c8b1917ebc652c6788d6d6c69c72d2'
3
+ metadata.gz: 7d7e4b37785b4d1f70b3721aa387bb0101b42fc54965e540ba3ad3f830490d44
4
+ data.tar.gz: 3b804cf40fd405311f71ee157e6eb364019bf464cd49a4ef052e98646b8fba75
5
5
  SHA512:
6
- metadata.gz: 54e24451d92bed2cfb93bda006c78d2d311f9e3e5a1a283cebc7f66e3908c4c5977b81a87ce265a1389e16ef6b8759759ca0e7ac5f304ff35a682bb29e2d9a12
7
- data.tar.gz: cd741d2ff564082916e9782408762d8117b17d45afae4e8d90e3ddb442c0d1e79e84b3e5beb492387d7f971b5ee15f7db679a9c8e2d2c6753eecfc5adc87ea55
6
+ metadata.gz: 1960575ba4e2b6408a7370867f26257de717f4203051f7f5ebb539d324b309c51e555106351e3e21ac1bf145432d7209d742ed8758a30bd068ca1207ac2fa4cb
7
+ data.tar.gz: 3c40989a2707bedf404c19bf0a6f2d3b425f611db081f9f590dbef8e359987927d33a5cf58cde9175b2dffe7a0678b9bc7b080075c4894588ccc401d76801f2a
data/config/routes.rb CHANGED
@@ -1,9 +1,16 @@
1
1
  Usps::Support::Engine.routes.draw do
2
2
  if defined?(Sidekiq::Web)
3
- unless Sidekiq::Web.middlewares.any? { it.first == Usps::Support::SidekiqAuth }
4
- Sidekiq::Web.use(Usps::Support::SidekiqAuth)
5
- end
6
- mount Sidekiq::Web => '/sidekiq'
3
+ # Gate the Sidekiq dashboard with JWT/admin auth, scoped to THIS engine mount via Rack::Builder.
4
+ # Calling Sidekiq::Web.use(...) instead would mutate the *global* Sidekiq::Web for every app that
5
+ # merely loads the engine — even one that never mounts it — so e.g. a Devise app with its own
6
+ # Sidekiq::Web mount would get wrapped in this JWT gate and lock its admins out. Scoping the
7
+ # middleware to the mounted instance ties the gate to actually mounting the engine.
8
+ sidekiq_dashboard = Rack::Builder.new do
9
+ use Usps::Support::SidekiqAuth
10
+ run Sidekiq::Web
11
+ end.to_app
12
+
13
+ mount sidekiq_dashboard, at: '/sidekiq', as: :sidekiq
7
14
  end
8
15
 
9
16
  resource :admin, only: [], controller: 'usps/support/admins' do
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Support
5
- VERSION = '0.2.46'
5
+ VERSION = '0.2.47'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.46
4
+ version: 0.2.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander