diff options
| author | Stefan Boberg <[email protected]> | 2026-04-02 10:51:07 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2026-04-02 10:51:07 +0200 |
| commit | ebb7ecfb10de0d08e1388d701f124977d4b9fb53 (patch) | |
| tree | 3715fbfe4cbd923d634b3861a64338c14fd67c61 /src/zenhttp/httpclientauth.cpp | |
| parent | added LoggerRef constructor accepting a string, for convenience (diff) | |
| download | zen-ebb7ecfb10de0d08e1388d701f124977d4b9fb53.tar.xz zen-ebb7ecfb10de0d08e1388d701f124977d4b9fb53.zip | |
Improve OidcToken auth diagnostics and use --HordeUrl for Horde servers
- Log full command line on OidcToken failure instead of just the exe path
- Use --HordeUrl flag for Horde server URLs, --AuthConfigUrl for others
(e.g. Jupiter), controlled by new IsHordeUrl parameter
- Add specific warnings in HordeConfig::Validate for each failure reason
Diffstat (limited to 'src/zenhttp/httpclientauth.cpp')
| -rw-r--r-- | src/zenhttp/httpclientauth.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp index c42841922..0432e50ef 100644 --- a/src/zenhttp/httpclientauth.cpp +++ b/src/zenhttp/httpclientauth.cpp @@ -94,7 +94,8 @@ namespace zen { namespace httpclientauth { std::string_view CloudHost, bool Unattended, bool Quiet, - bool Hidden) + bool Hidden, + bool IsHordeUrl) { Stopwatch Timer; @@ -117,8 +118,9 @@ namespace zen { namespace httpclientauth { } }); - const std::string ProcArgs = fmt::format("{} --AuthConfigUrl {} --OutFile {} --Unattended={}", + const std::string ProcArgs = fmt::format("{} {} {} --OutFile {} --Unattended={}", OidcExecutablePath, + IsHordeUrl ? "--HordeUrl" : "--AuthConfigUrl", CloudHost, AuthTokenPath, Unattended ? "true"sv : "false"sv); @@ -193,7 +195,7 @@ namespace zen { namespace httpclientauth { } else { - ZEN_WARN("Failed running {} to get auth token, error code {}", OidcExecutablePath, ExitCode); + ZEN_WARN("Failed running '{}' to get auth token, error code {}", ProcArgs, ExitCode); } return HttpClientAccessToken{}; } @@ -202,9 +204,10 @@ namespace zen { namespace httpclientauth { std::string_view CloudHost, bool Quiet, bool Unattended, - bool Hidden) + bool Hidden, + bool IsHordeUrl) { - HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden); + HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden, IsHordeUrl); if (InitialToken.IsValid()) { return [OidcExecutablePath = std::filesystem::path(OidcExecutablePath), @@ -212,12 +215,13 @@ namespace zen { namespace httpclientauth { Token = InitialToken, Quiet, Unattended, - Hidden]() mutable { + Hidden, + IsHordeUrl]() mutable { if (!Token.NeedsRefresh()) { return std::move(Token); } - return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden); + return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden, IsHordeUrl); }; } return {}; |