From 0608cf2e17704cd9126af9e875fc75656613fc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Wn=C4=99trzak?= Date: Fri, 25 Sep 2020 11:56:48 +0200 Subject: [PATCH] Add info how to setup basic auth for engine --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 167c98f8d..06021f91f 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,16 @@ GoodJob includes a Dashboard as a mountable `Rails::Engine`. end ``` + Another option is using basic auth like this: + + ```ruby + # config/initializers/good_job.rb + GoodJob::Engine.middleware.use(Rack::Auth::Basic) do |username, password| + ActiveSupport::SecurityUtils.secure_compare(Rails.application.credentials.good_job_username, username) && + ActiveSupport::SecurityUtils.secure_compare(Rails.application.credentials.good_job_password, password) + end + ``` + ## Go deeper ### Exceptions, retries, and reliability