Fix global vs persistent session backend

This commit is contained in:
Daniel Berteaud 2024-02-07 16:53:32 +01:00
parent f7e23ba356
commit f79b3a89a2
2 changed files with 10 additions and 8 deletions

View File

@ -10,15 +10,17 @@ localSessionStorageOptions = { \
'cache_root' => '/tmp', \
'cache_depth' => 3 \
}
globalStorage = Lemonldap::NG::Common::Apache::Session::REST
globalStorageOptions = { \
baseUrl => "[[ .lemonldap.sessions.url ]]", \
[[- if and (has .lemonldap.sessions "user") (has .lemonldap.sessions "password") (has .lemonldap.sessions "realm") ]]
user => "[[ .lemonldap.sessions.user ]]", \
password => "[[ .lemonldap.sessions.password ]]", \
realm => "[[ .lemonldap.sessions.realm ]]", \
[[- range $idx, $module := coll.Slice "global" "persistent" ]]
[[ $module ]]Storage = Lemonldap::NG::Common::Apache::Session::REST
[[ $module ]]StorageOptions = { \
baseUrl => "[[ $.lemonldap.sessions.url ]]/[[ $module ]]", \
[[- if and (has $.lemonldap.sessions "user") (has $.lemonldap.sessions "password") (has $.lemonldap.sessions "realm") ]]
user => "[[ $.lemonldap.sessions.user ]]", \
password => "[[ $.lemonldap.sessions.password ]]", \
realm => "[[ $.lemonldap.sessions.realm ]]", \
[[- end ]]
}
[[- end ]]
[configuration]
type = REST

View File

@ -108,7 +108,7 @@ lemonldap:
realm: Lemonldap::NG API
sessions:
url: https://auth.example.org/index.psgi/sessions/global
url: https://auth.example.org/index.psgi/sessions
# user: lemonldap
# password: secret
realm: Lemonldap::NG API