diff options
| author | Dan Engelbrecht <[email protected]> | 2025-09-22 13:41:33 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-09-22 13:41:33 +0200 |
| commit | 69bc4d03fc050ae43bb0628b0a5e0dfdcaf38735 (patch) | |
| tree | 301bc5d42fef96c5a6208b080ec5299bb0ce6496 /src | |
| parent | change default sentry dsn to one listed on Sentry setup page (#504) (diff) | |
| download | zen-69bc4d03fc050ae43bb0628b0a5e0dfdcaf38735.tar.xz zen-69bc4d03fc050ae43bb0628b0a5e0dfdcaf38735.zip | |
Added `--oidctoken-exe-unattended` to`zen builds` and `zen oplog-download` command to use unattended mode when launching oidc-token.exe (#506)
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/authutils.cpp | 9 | ||||
| -rw-r--r-- | src/zen/authutils.h | 1 | ||||
| -rw-r--r-- | src/zenhttp/httpclientauth.cpp | 5 | ||||
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpclientauth.h | 3 | ||||
| -rw-r--r-- | src/zenserver/projectstore/buildsremoteprojectstore.cpp | 8 | ||||
| -rw-r--r-- | src/zenserver/projectstore/buildsremoteprojectstore.h | 3 | ||||
| -rw-r--r-- | src/zenserver/projectstore/jupiterremoteprojectstore.cpp | 5 | ||||
| -rw-r--r-- | src/zenserver/projectstore/jupiterremoteprojectstore.h | 3 | ||||
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 4 |
9 files changed, 29 insertions, 12 deletions
diff --git a/src/zen/authutils.cpp b/src/zen/authutils.cpp index 558398d79..69ea3f9c2 100644 --- a/src/zen/authutils.cpp +++ b/src/zen/authutils.cpp @@ -132,6 +132,12 @@ AuthCommandLineOptions::AddOptions(cxxopts::Options& Ops) "Path to OidcToken executable", cxxopts::value<std::string>(m_OidcTokenAuthExecutablePath)->default_value(""), ""); + Ops.add_option("auth", + "", + "oidctoken-exe-unattended", + "Set mode to unattended when launcing OidcToken executable", + cxxopts::value<bool>(m_OidcTokenUnattended), + ""); }; void @@ -227,7 +233,8 @@ AuthCommandLineOptions::ParseOptions(cxxopts::Options& Ops, } else if (std::filesystem::path OidcTokenExePath = FindOidcTokenExePath(m_OidcTokenAuthExecutablePath); !OidcTokenExePath.empty()) { - ClientSettings.AccessTokenProvider = httpclientauth::CreateFromOidcTokenExecutable(OidcTokenExePath, HostUrl, Quiet); + ClientSettings.AccessTokenProvider = + httpclientauth::CreateFromOidcTokenExecutable(OidcTokenExePath, HostUrl, Quiet, m_OidcTokenUnattended); } if (!ClientSettings.AccessTokenProvider) diff --git a/src/zen/authutils.h b/src/zen/authutils.h index f8ab4e03b..3cc9d4d4a 100644 --- a/src/zen/authutils.h +++ b/src/zen/authutils.h @@ -32,6 +32,7 @@ struct AuthCommandLineOptions std::string m_OAuthClientSecret; std::string m_OidcTokenAuthExecutablePath; + bool m_OidcTokenUnattended = false; void AddOptions(cxxopts::Options& Ops); diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp index 62e1b77bc..4bbc6405b 100644 --- a/src/zenhttp/httpclientauth.cpp +++ b/src/zenhttp/httpclientauth.cpp @@ -176,9 +176,10 @@ namespace zen { namespace httpclientauth { std::optional<std::function<HttpClientAccessToken()>> CreateFromOidcTokenExecutable(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, - bool Quiet) + bool Quiet, + bool Unattended) { - HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, /* Unattended */ false, Quiet); + HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet); if (InitialToken.IsValid()) { return [OidcExecutablePath = std::filesystem::path(OidcExecutablePath), diff --git a/src/zenhttp/include/zenhttp/httpclientauth.h b/src/zenhttp/include/zenhttp/httpclientauth.h index 32d00f87f..f44cb9b0d 100644 --- a/src/zenhttp/include/zenhttp/httpclientauth.h +++ b/src/zenhttp/include/zenhttp/httpclientauth.h @@ -28,7 +28,8 @@ namespace httpclientauth { std::optional<std::function<HttpClientAccessToken()>> CreateFromOidcTokenExecutable(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, - bool Quiet); + bool Quiet, + bool Unattended); } // namespace httpclientauth } // namespace zen diff --git a/src/zenserver/projectstore/buildsremoteprojectstore.cpp b/src/zenserver/projectstore/buildsremoteprojectstore.cpp index a9dd48510..0b0d8ccd0 100644 --- a/src/zenserver/projectstore/buildsremoteprojectstore.cpp +++ b/src/zenserver/projectstore/buildsremoteprojectstore.cpp @@ -470,7 +470,10 @@ private: }; std::shared_ptr<RemoteProjectStore> -CreateJupiterBuildsRemoteStore(const BuildsRemoteStoreOptions& Options, const std::filesystem::path& TempFilePath, bool Quiet) +CreateJupiterBuildsRemoteStore(const BuildsRemoteStoreOptions& Options, + const std::filesystem::path& TempFilePath, + bool Quiet, + bool Unattended) { std::string Url = Options.Url; if (Url.find("://"sv) == std::string::npos) @@ -495,7 +498,8 @@ CreateJupiterBuildsRemoteStore(const BuildsRemoteStoreOptions& Options, const st } else if (!Options.OidcExePath.empty()) { - if (auto TokenProviderMaybe = httpclientauth::CreateFromOidcTokenExecutable(Options.OidcExePath, Url, Quiet); TokenProviderMaybe) + if (auto TokenProviderMaybe = httpclientauth::CreateFromOidcTokenExecutable(Options.OidcExePath, Url, Quiet, Unattended); + TokenProviderMaybe) { TokenProvider = TokenProviderMaybe.value(); } diff --git a/src/zenserver/projectstore/buildsremoteprojectstore.h b/src/zenserver/projectstore/buildsremoteprojectstore.h index 60b6caef7..24ab9678d 100644 --- a/src/zenserver/projectstore/buildsremoteprojectstore.h +++ b/src/zenserver/projectstore/buildsremoteprojectstore.h @@ -26,6 +26,7 @@ struct BuildsRemoteStoreOptions : RemoteStoreOptions std::shared_ptr<RemoteProjectStore> CreateJupiterBuildsRemoteStore(const BuildsRemoteStoreOptions& Options, const std::filesystem::path& TempFilePath, - bool Quiet); + bool Quiet, + bool Unattended); } // namespace zen diff --git a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp index a8d486e2a..da3f92353 100644 --- a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp +++ b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp @@ -343,7 +343,7 @@ private: }; std::shared_ptr<RemoteProjectStore> -CreateJupiterRemoteStore(const JupiterRemoteStoreOptions& Options, const std::filesystem::path& TempFilePath, bool Quiet) +CreateJupiterRemoteStore(const JupiterRemoteStoreOptions& Options, const std::filesystem::path& TempFilePath, bool Quiet, bool Unattended) { std::string Url = Options.Url; if (Url.find("://"sv) == std::string::npos) @@ -374,7 +374,8 @@ CreateJupiterRemoteStore(const JupiterRemoteStoreOptions& Options, const std::fi } else if (!Options.OidcExePath.empty()) { - if (auto TokenProviderMaybe = httpclientauth::CreateFromOidcTokenExecutable(Options.OidcExePath, Url, Quiet); TokenProviderMaybe) + if (auto TokenProviderMaybe = httpclientauth::CreateFromOidcTokenExecutable(Options.OidcExePath, Url, Quiet, Unattended); + TokenProviderMaybe) { TokenProvider = TokenProviderMaybe.value(); } diff --git a/src/zenserver/projectstore/jupiterremoteprojectstore.h b/src/zenserver/projectstore/jupiterremoteprojectstore.h index ac2d25b47..d7a22700a 100644 --- a/src/zenserver/projectstore/jupiterremoteprojectstore.h +++ b/src/zenserver/projectstore/jupiterremoteprojectstore.h @@ -26,6 +26,7 @@ struct JupiterRemoteStoreOptions : RemoteStoreOptions std::shared_ptr<RemoteProjectStore> CreateJupiterRemoteStore(const JupiterRemoteStoreOptions& Options, const std::filesystem::path& TempFilePath, - bool Quiet); + bool Quiet, + bool Unattended); } // namespace zen diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 97175da23..e84e2e5f8 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -268,7 +268,7 @@ namespace { ForceDisableBlocks, ForceDisableTempBlocks, AssumeHttp2}; - RemoteStore = CreateJupiterRemoteStore(Options, TempFilePath, /*Quiet*/ false); + RemoteStore = CreateJupiterRemoteStore(Options, TempFilePath, /*Quiet*/ false, /*Unattended*/ false); } if (CbObjectView Zen = Params["zen"sv].AsObjectView(); Zen) @@ -365,7 +365,7 @@ namespace { ForceDisableTempBlocks, AssumeHttp2, MetaData}; - RemoteStore = CreateJupiterBuildsRemoteStore(Options, TempFilePath, /*Quiet*/ false); + RemoteStore = CreateJupiterBuildsRemoteStore(Options, TempFilePath, /*Quiet*/ false, /*Unattended*/ false); } if (!RemoteStore) |