Skip to content

Add authorization to jobs module (updated PR) #44

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

Merged
merged 3 commits into from
Jan 31, 2018

Conversation

notzippy
Copy link
Contributor

@notzippy notzippy commented Jul 26, 2017

From PR #15

This change will allow users to require authentication via HTTP Basic Authentication prior to accessing the /@jobs page.

It introduces the following config options:

  • jobs.auth (bool, default=false) Is authentication required?
  • jobs.auth.user (string) Required username
  • jobs.auth.pass (string) Required password (or its SHA-256-hash, if jobs.auth.sha256 is true)
  • jobs.auth.sha256 (bool, default=false) Is the password SHA-256-hashed? You probably don't want your passwords in clear text in config files.

If no user and pass is specified in the config, access will always be denied.
If authorization is enabled, local IP checking will be disabled.

This feature was requested at the jobs documentation page, so I felt free to implement it.

TODO

  • docs updating for app.conf

ninavdl and others added 2 commits August 16, 2015 21:12
With this change to the jobs module it will be possible to require users to authenticate themselves prior to accessing the /@jobs page.
@notzippy notzippy added this to the v0.18 milestone Jul 26, 2017
@notzippy notzippy changed the title Ninov feature/jobs auth Add authorization to jobs module (updated PR) Jul 26, 2017
"github.com/revel/modules/jobs/app/jobs"
"github.com/revel/revel"
"github.com/robfig/cron"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revel/cron?


// Verify that a username and password are given in the config file
if !found_pass || !found_user {
return c.unauthorized()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why lower case un?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not need to be exported

@notzippy notzippy force-pushed the ninov-feature/jobs-auth branch from 1754e0b to 1c9cd39 Compare August 4, 2017 03:07
@notzippy notzippy modified the milestones: v0.19, v0.18 Aug 30, 2017
@notzippy notzippy merged commit 593902c into revel:develop Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants