added BYOS (Bring Your Own SERVICE_ACCOUNT) for GCS authentication (#3262)

This commit is contained in:
Akash Shanmugaraj 2024-01-27 18:27:12 +05:30 committed by GitHub
parent 83bbe4ec37
commit aeb6acf640
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 88 additions and 12 deletions

View file

@ -64,6 +64,7 @@ int CmdSync::execute (std::string& output)
// If no server is set up, quit.
std::string origin = Context::getContext ().config.get ("sync.server.origin");
std::string server_dir = Context::getContext ().config.get ("sync.local.server_dir");
std::string gcp_credential_path = Context::getContext ().config.get ("sync.gcp.credential_path");
std::string gcp_bucket = Context::getContext ().config.get ("sync.gcp.bucket");
std::string encryption_secret = Context::getContext ().config.get ("sync.encryption_secret");
if (server_dir != "") {
@ -73,7 +74,7 @@ int CmdSync::execute (std::string& output)
if (encryption_secret == "") {
throw std::string ("sync.encryption_secret is required");
}
server = tc::Server::new_gcp (gcp_bucket, encryption_secret);
server = tc::Server::new_gcp (gcp_bucket, gcp_credential_path, encryption_secret);
std::ostringstream os;
os << "GCP bucket " << gcp_bucket;
server_ident = os.str();