Type:
Class

Htpasswd accesses apache-compatible password files. Passwords are matched to a realm where they are valid. For security, the path for a password database should be stored outside of the paths available to the HTTP server.

Htpasswd is intended for use with WEBrick::HTTPAuth::BasicAuth.

To create an Htpasswd database with a single user:

1
2
3
htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file'
htpasswd.set_passwd 'my realm', 'username', 'password'
htpasswd.flush
get_passwd
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

get_passwd(realm, user, reload_db) Instance Public methods Retrieves a password

2025-01-10 15:47:30
flush
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

flush(output=nil) Instance Public methods Flush the password database. If output

2025-01-10 15:47:30
delete_passwd
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

delete_passwd(realm, user) Instance Public methods Removes a password from the

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

new(path) Class Public methods Open a password database at path

2025-01-10 15:47:30
each
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

each() Instance Public methods Iterate passwords in the database.

2025-01-10 15:47:30
set_passwd
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

set_passwd(realm, user, pass) Instance Public methods Sets a password in the

2025-01-10 15:47:30
reload
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::Htpasswd

reload() Instance Public methods Reload passwords from the database

2025-01-10 15:47:30