-
Notifications
You must be signed in to change notification settings - Fork 48
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
(POOLER-71) Add dummy authentication provider #180
(POOLER-71) Add dummy authentication provider #180
Conversation
👍 |
I can rebase onto master if it's easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broadly like this, but can the dummy auth be confined to only run in development or test mode? It seems like there's nothing stopping it from running in production mode and that's kind of horrifying.
Gemfile
Outdated
|
||
# Evaluate Gemfile.local if it exists | ||
if File.exists? "#{__FILE__}.local" | ||
eval(File.read("#{__FILE__}.local"), binding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not generally a fan of the Gemfile.local
pattern, but it's not something I feel strongly enough about to push back on.
BUT! You can eschew the passing of binding
if you use instance_eval
instead:
instance_eval(File.read("#{__FILE__}.local")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll piggyback these comments over to #177
@mckern Actually I can do one of a few things. As part of #177 I added a VMPOOLER_DEBUG environment variable.
I'm leaning towards option 3. Fail hard, fail fast. |
e847137
to
3c441ac
Compare
Rebased off of master now. The PR ordering just served to confuse things. |
Previously it was difficult to do local development as VMPooler requires an LDAP service for authentication. This commit adds a dummy authentication provider. The provider has passes authentication if the username and password are different, and fails if the username and password are the same. This commit also updates the documentation in the config YML file.
a82b243
to
2c74f4f
Compare
lib/vmpooler.rb
Outdated
@@ -32,6 +32,17 @@ def self.config(filepath='vmpooler.yaml') | |||
parsed_config = YAML.load_file(config_file) | |||
end | |||
|
|||
# Bail out if someone attempts to start vmpooler with dummy authentication | |||
# without enbaling debug mode. | |||
if parsed_config[:auth]['provider'] == 'dummy' && ENV['VMPOOLER_DEBUG'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this needs to be fixed. Good job, me!
c8e591d
to
c1216d4
Compare
If a user attempts to start vmpooler using dummy authentication without setting the environment variable VMPOOLER_DEBUG, the vmpooler will now refuse to start.
c1216d4
to
eb67cca
Compare
Changes are fine by me. LGTM |
Previously it was difficult to do local development as VMPooler requires an LDAP
service for authentication. This commit adds a dummy authentication provider.
The provider has passes authentication if the username and password are
different, and fails if the username and password are the same. This commit
also updates the documentation in the config YML file.