Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to hide in staging environment unless I explicitly run authorize_request? #67

Closed
tetherit opened this issue Mar 15, 2014 · 4 comments

Comments

@tetherit
Copy link

How would I hide rack-mini-profiler in staging unless I explicitly run Rack::MiniProfiler.authorize_request?

it seems the "staging" environment is for some reason handled like the development environment and rack_mini_profiler is always displayed.

@tetherit
Copy link
Author

I tried to put this in my initialiser file:

Rack::MiniProfiler.config.position = 'right'
# Explicitly authorise in application controller
Rack::MiniProfiler.config.pre_authorize_cb = lambda { |env| false }

And in my application controller I have a before filter that runs:

before_filter :authorise!

def authorise!
  Rack::MiniProfiler.authorize_request
end

I am running in development mode and mini profiler never shows up. Any ideas?

@tetherit
Copy link
Author

I found an undocumented option that does what I want:

Rack::MiniProfiler.config.authorization_mode = :whitelist

Can you please add this to the usage examples for others that have a staging environment or any other environment other than production that requires more fine grained control?

@jonathanhefner
Copy link
Contributor

I believe this may have been fixed by #239.

@SamSaffron
Copy link
Member

Yep, I think our documentation for auth modes is much better now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants