mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(POOLER-71) Add dummy authentication provider
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.
This commit is contained in:
parent
71a5af9e88
commit
2c74f4fa3a
2 changed files with 26 additions and 3 deletions
|
|
@ -56,6 +56,8 @@ module Vmpooler
|
||||||
|
|
||||||
def authenticate(auth, username_str, password_str)
|
def authenticate(auth, username_str, password_str)
|
||||||
case auth['provider']
|
case auth['provider']
|
||||||
|
when 'dummy'
|
||||||
|
return (username_str != password_str)
|
||||||
when 'ldap'
|
when 'ldap'
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'net/ldap'
|
require 'net/ldap'
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,22 @@
|
||||||
# This section contains information related to authenticating users
|
# This section contains information related to authenticating users
|
||||||
# for token operations.
|
# for token operations.
|
||||||
#
|
#
|
||||||
# Currently the only supported provider is LDAP; the following parameters
|
# Supported Auth Providers:
|
||||||
# will all be under an ':ldap:' subsection (see example below).
|
# - Dummy
|
||||||
|
# - LDAP
|
||||||
|
#
|
||||||
|
# - Dummy Auth Provider
|
||||||
|
# The Dummy Authentication provider should only be used during development or testing
|
||||||
|
# If the Username and Password are different then validation succeeds
|
||||||
|
# If the Username and Password are the same then validation fails
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# :auth:
|
||||||
|
# provider: 'dummy'
|
||||||
|
#
|
||||||
|
# - LDAP Auth Provider
|
||||||
|
# The LDAP Authentication provider will validate usernames and passwords against an
|
||||||
|
# existing LDAP service
|
||||||
#
|
#
|
||||||
# Available configuration parameters:
|
# Available configuration parameters:
|
||||||
#
|
#
|
||||||
|
|
@ -154,8 +168,15 @@
|
||||||
#
|
#
|
||||||
# - user_object
|
# - user_object
|
||||||
# The LDAP object-type used to designate a user object.
|
# The LDAP object-type used to designate a user object.
|
||||||
|
#
|
||||||
# Example:
|
# Example:
|
||||||
|
# :auth:
|
||||||
|
# provider: 'ldap'
|
||||||
|
# :ldap:
|
||||||
|
# host: 'localhost'
|
||||||
|
# port: 389
|
||||||
|
# base: 'ou=users,dc=company,dc=com'
|
||||||
|
# user_object: 'uid'
|
||||||
|
|
||||||
:auth:
|
:auth:
|
||||||
provider: 'ldap'
|
provider: 'ldap'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue