Class: RhaproxyUserlist
- Inherits:
-
Object
- Object
- RhaproxyUserlist
- Defined in:
- lib/rhaproxy/userlist.rb
Overview
It is possible to control access to frontend/backend/listen sections or to http stats by allowing only authenticated and authorized users. To do this, it is required to create at least one userlist and to define users.
Instance Attribute Summary collapse
-
#group ⇒ Object
group <groupname> [users <user>,<user>,(…)] Adds group <groupname> to the current userlist.
-
#name ⇒ Object
name <listname> Creates new userlist with name <listname>.
-
#user ⇒ Object
user <username> [password|insecure-password <password>] [groups <group>,<group>,(…)] Adds user <username> to the current userlist.
Instance Method Summary collapse
-
#config ⇒ Object
Compile the HAproxy userlist configuration.
-
#initialize ⇒ RhaproxyUserlist
constructor
Returns a new RhaproxyUserlist Object.
Constructor Details
#initialize ⇒ RhaproxyUserlist
Returns a new RhaproxyUserlist Object
49 50 |
# File 'lib/rhaproxy/userlist.rb', line 49 def initialize() end |
Instance Attribute Details
#group ⇒ Object
group <groupname> [users <user>,<user>,(…)]
Adds group <groupname> to the current userlist. It is also possible to
attach users to this group by using a comma separated list of names
proceeded by "users" keyword.
32 33 34 |
# File 'lib/rhaproxy/userlist.rb', line 32 def group @group end |
#name ⇒ Object
name <listname>
Creates new userlist with name <listname>. Many independent userlists can be
used to store authentication & authorization data for independent customers.
24 25 26 |
# File 'lib/rhaproxy/userlist.rb', line 24 def name @name end |
#user ⇒ Object
user <username> [password|insecure-password <password>]
[groups <group>,<group>,(...)]
Adds user <username> to the current userlist. Both secure (encrypted) and
insecure (unencrypted) passwords can be used. Encrypted passwords are
evaluated using the crypt(3) function so depending of the system's
capabilities, different algorithms are supported. For example modern Glibc
based Linux system supports MD5, SHA-256, SHA-512 and of course classic,
DES-based method of crypting passwords.
44 45 46 |
# File 'lib/rhaproxy/userlist.rb', line 44 def user @user end |
Instance Method Details
#config ⇒ Object
Compile the HAproxy userlist configuration
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/rhaproxy/userlist.rb', line 55 def config if @name conf = option_string() return conf else puts "no userlists name defined" return false end end |