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

I want to contribute and implement http_auth but need guidance on best practice/syntax #166

Open
krtschmr opened this issue Oct 1, 2024 · 0 comments · May be fixed by #171
Open

I want to contribute and implement http_auth but need guidance on best practice/syntax #166

krtschmr opened this issue Oct 1, 2024 · 0 comments · May be fixed by #171

Comments

@krtschmr
Copy link

krtschmr commented Oct 1, 2024

While we can inherit from our own BaseController to implement authentication, i wanted to provide an easy http_auth way.

i thought about the following syntax:

mount MissionControl::Jobs::Engine, at: "/jobs", http_auth: { user: "test", password: "123456" }

i would like to skip it if .test? or .development? so that means .production? or any other environment would have it active.
additionally i would like to http_auth if ENV["MISSION_CONTROL_JOBS_USER"] && ENV["MISSION_CONTROL_JOBS_PASSWORD"] is set, regardless of environment.

So either you set it via ENV and it's active, or you can set it via http_auth option while mounting.

I'm just exploring if that syntax make sense and the PR would get merged? Otherwise i don't need to spend time on that ;-)

// edit: i realized that options provided are actually for mount and won't be forwarded to the engine.
i'll just do ENV and config support

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