caddyauth: Allow user-configurable headers and status code

This commit is contained in:
Ivan Trubach 2025-10-03 22:57:45 +03:00
parent f5f25d845a
commit 1b2abe0c1a
No known key found for this signature in database
12 changed files with 636 additions and 17 deletions

View file

@ -0,0 +1,59 @@
https://example.com
basic_auth bcrypt {
Aladdin $2a$14$U5nG2p.Ac09gzn9oo5aRe.YnsXn30UdXA6pRUn45KFqADG636dRHa
}
----------
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"example.com"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "authentication",
"providers": {
"http_basic": {
"accounts": [
{
"password": "$2a$14$U5nG2p.Ac09gzn9oo5aRe.YnsXn30UdXA6pRUn45KFqADG636dRHa",
"username": "Aladdin"
}
],
"hash": {
"algorithm": "bcrypt"
},
"hash_cache": {}
}
}
}
]
}
]
}
],
"terminal": true
}
]
}
}
}
}
}