Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bunnylushington/Apache.htpasswd
Apache httpasswd file reader/writer in Elixir
https://github.com/bunnylushington/Apache.htpasswd
Last synced: 2 months ago
JSON representation
Apache httpasswd file reader/writer in Elixir
- Host: GitHub
- URL: https://github.com/bunnylushington/Apache.htpasswd
- Owner: bunnylushington
- Created: 2014-09-28T19:45:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-04T17:06:25.000Z (almost 5 years ago)
- Last Synced: 2024-10-19T20:54:34.599Z (3 months ago)
- Language: Elixir
- Size: 180 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Apache htpasswd file reader/writer in Elixir. (Authentication)
- fucking-awesome-elixir - htpasswd - Apache htpasswd file reader/writer in Elixir. (Authentication)
- awesome-elixir - htpasswd - Apache htpasswd file reader/writer in Elixir. (Authentication)
README
# Apache.Htpasswd
Provides basic htpasswd(1) functions as a library. The hashing
methods available are :md5 (the default), :sha, :crypt, and
:plaintext.## Examples
iex> Apache.Htpasswd.check "user:pass", "test/htfile"
false
iex> Apache.Htpasswd.check "plaintext:plaintext", "test/htfile"
true
iex> Apache.Htpasswd.encode "user", "pass"
{:ok, "user:$apr1$I9cKzQKi$XqBj0dWlCV9j5XpVC1H6a0"}
iex> Apache.Htpasswd.encode "user", "pass", :sha
{:ok, "user:{SHA}nU4eI71bcnBGqeO0t9tXvY1u5oQ="}
iex> Apache.Htpasswd.check "user:pass",
...> Apache.Htpasswd.encode!("user", "pass")
true
iex> Apache.Htpasswd.add("user", "pass", "/tmp/htpasswd")
{:ok, "user:$apr1$on6He14N$3AeecTsC32uTadbYK1Ij4/"}
iex> Apache.Htpasswd.rm("user", "/tmp/htpasswd")
:ok## Requirements
Apache.Htpasswd depends on the Elixir package `apache_passwd_md5` and,
optionally, the Erlang crypt library (if crypt style passwords are
going to be read or written). I've tried to ensure that the code
works just fine in default (:md5) mode if the crypt library isn't
present. If you run into trouble, please drop me a line and I'll take
a look.--------
The MIT License (MIT)
Copyright (c) 2014 Kevin Montuori & BAPI Consulting.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.