diff options
| author | Dan Engelbrecht <[email protected]> | 2025-10-06 10:30:44 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-06 10:30:44 +0200 |
| commit | 0d8e54e660560264df4a9b096867cb9b68d99a00 (patch) | |
| tree | 5f90099d4447c0a007b01b156dd69d04d74170d1 /src/zenhttp/httpclientauth.cpp | |
| parent | speed up tests (#555) (diff) | |
| download | zen-0d8e54e660560264df4a9b096867cb9b68d99a00.tar.xz zen-0d8e54e660560264df4a9b096867cb9b68d99a00.zip | |
added Hidden option to oidctoken creation with oidc token exe (#556)
Diffstat (limited to 'src/zenhttp/httpclientauth.cpp')
| -rw-r--r-- | src/zenhttp/httpclientauth.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp index 4438fc137..8754c57d6 100644 --- a/src/zenhttp/httpclientauth.cpp +++ b/src/zenhttp/httpclientauth.cpp @@ -94,7 +94,8 @@ namespace zen { namespace httpclientauth { static HttpClientAccessToken GetOidcTokenFromExe(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, bool Unattended, - bool Quiet) + bool Quiet, + bool Hidden) { Stopwatch Timer; @@ -103,6 +104,10 @@ namespace zen { namespace httpclientauth { { ProcOptions.StdoutFile = std::filesystem::temp_directory_path() / fmt::format(".zen-auth-output-{}", Oid::NewOid()); } + if (Hidden) + { + ProcOptions.Flags |= CreateProcOptions::Flag_NoConsole; + } const std::filesystem::path AuthTokenPath(std::filesystem::temp_directory_path() / fmt::format(".zen-auth-{}", Oid::NewOid())); auto _ = MakeGuard([AuthTokenPath, &ProcOptions]() { @@ -181,14 +186,16 @@ namespace zen { namespace httpclientauth { std::optional<std::function<HttpClientAccessToken()>> CreateFromOidcTokenExecutable(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, bool Quiet, - bool Unattended) + bool Unattended, + bool Hidden) { - HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet); + HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden); if (InitialToken.IsValid()) { return [OidcExecutablePath = std::filesystem::path(OidcExecutablePath), CloudHost = std::string(CloudHost), Quiet, + Hidden, InitialToken]() mutable { if (InitialToken.IsValid()) { @@ -196,7 +203,7 @@ namespace zen { namespace httpclientauth { InitialToken = {}; return Result; } - return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, /* Unattended */ true, Quiet); + return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, /* Unattended */ true, Quiet, Hidden); }; } return {}; |