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

Closed
krtschmr opened this issue Oct 1, 2024 · 3 comments

Comments

@krtschmr
Copy link
Contributor

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

@morgoth
Copy link
Member

morgoth commented Dec 5, 2024

@krtschmr basic auth support was added in #214

@rosa
Copy link
Member

rosa commented Dec 5, 2024

@morgoth yes! I cherry-picked one of @krtschmr's commits for that and he reviewed my PR 😊 I had forgotten to close this one, closing now!

@rosa rosa closed this as completed Dec 5, 2024
@krtschmr
Copy link
Contributor Author

krtschmr commented Dec 5, 2024

good stuff. happy open source development nowadays!

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