-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1467] Add multi-user support in Auth basic plugin with dynamic user…
…-password handling and update AUTH_BASIC_LOCATION regex to be more open
- Loading branch information
1 parent
5c21ecb
commit 5e5130c
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
{%- if USE_AUTH_BASIC == "yes" -%} | ||
{%- set passlib_hash = import('passlib.hash') -%} | ||
{{ AUTH_BASIC_USER }}:{{ passlib_hash.sha512_crypt.hash(AUTH_BASIC_PASSWORD) }} | ||
{%- endif %} | ||
{% for k, v in all.items() %} | ||
{% if k.startswith("AUTH_BASIC_USER") and v != "" -%} | ||
{% set user = v %} | ||
{% set password = all[k.replace("USER", "PASSWORD")] if k.replace("USER", "PASSWORD") in all else "" %} | ||
{% if password != "" %} | ||
{{ user }}:{{ passlib_hash.sha512_crypt.hash(password) }} | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters