Sha256: 937052976320e417a51fe624d218fca2e6e1f35240564f94ef782a4dd9d71e28

Contents?: true

Size: 667 Bytes

Versions: 21

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

Rails.application.routes.draw do
  require "sidekiq/web"
  require "sidekiq/cron/web"

  def _secure_compare(s1, s2)
    ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(s1), ::Digest::SHA256.hexdigest(s2))
  end

  if %w[staging production].include?(Rails.env)
    Sidekiq::Web.use Rack::Auth::Basic do |username, password|
      _secure_compare(username, "sidekiq") & _secure_compare(password, Rails.application.secrets.sidekiq_web_password)
    end
  end

  if Rails.env.development?
    mount Sidekiq::Web, at: "/sidekiq"
  else
    mount Sidekiq::Web, at: "/sidekiq", constraints: { method: "GET" }
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
neeto-commons-backend-1.0.109 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.108 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.107 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.106 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.105 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.104 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.103 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.102 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.101 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.100 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.99 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.98 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.97 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.96 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.95 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.94 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.93 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.92 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.91 lib/neeto_commons_backend/routes/sidekiq.rb
neeto-commons-backend-1.0.90 lib/neeto_commons_backend/routes/sidekiq.rb