Skip to content

Commit

Permalink
C.41 compliance: GCS factory constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
bekadavis9 committed Dec 2, 2024
1 parent d766b3a commit f0ea81e
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 256 deletions.
21 changes: 4 additions & 17 deletions test/src/unit-vfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ TEST_CASE(
"[gcs][credentials][impersonation]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
std::string impersonate_service_account, target_service_account;
std::vector<std::string> delegates;

Expand All @@ -848,9 +847,7 @@ TEST_CASE(

require_tiledb_ok(cfg.set(
"vfs.gcs.impersonate_service_account", impersonate_service_account));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -870,16 +867,13 @@ TEST_CASE(
"[gcs][credentials][service-account]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string service_account_key = "{\"foo\": \"bar\"}";

require_tiledb_ok(
cfg.set("vfs.gcs.service_account_key", service_account_key));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -896,7 +890,6 @@ TEST_CASE(
"[gcs][credentials][service-account-and-impersonation]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string service_account_key = "{\"foo\": \"bar\"}";
Expand All @@ -906,9 +899,7 @@ TEST_CASE(
cfg.set("vfs.gcs.service_account_key", service_account_key));
require_tiledb_ok(cfg.set(
"vfs.gcs.impersonate_service_account", impersonate_service_account));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand All @@ -934,17 +925,13 @@ TEST_CASE(
"[gcs][credentials][external-account]") {
ThreadPool thread_pool(2);
Config cfg = set_config_params(true);
GCS gcs;
// The content of the credentials does not matter; it does not get parsed
// until it is used in an API request, which we are not doing.
std::string workload_identity_configuration = "{\"foo\": \"bar\"}";

require_tiledb_ok(cfg.set(
"vfs.gcs.workload_identity_configuration",
workload_identity_configuration));

require_tiledb_ok(gcs.init(cfg, &thread_pool));

GCS gcs(&thread_pool, cfg);
auto credentials = gcs.make_credentials({});

// We are using an internal class only for inspection purposes.
Expand Down
4 changes: 0 additions & 4 deletions tiledb/common/exception/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ inline Status Status_S3Error(const std::string& msg) {
inline Status Status_AzureError(const std::string& msg) {
return {"[TileDB::Azure] Error", msg};
}
/** Return a FS_GCS error class Status with a given message **/
inline Status Status_GCSError(const std::string& msg) {
return {"[TileDB::GCS] Error", msg};
}
/** Return a FS_HDFS error class Status with a given message **/
inline Status Status_HDFSError(const std::string& msg) {
return {"[TileDB::HDFS] Error", msg};
Expand Down
7 changes: 4 additions & 3 deletions tiledb/sm/cpp_api/config.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/**
* @file config.h
*
* @author Ravi Gaddipati
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2023 TileDB, Inc.
* @copyright Copyright (c) 2017-2024 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -627,6 +625,9 @@ class Config {
* The maximum permissible delay between Azure netwwork request retry
* attempts, in milliseconds.
* **Default**: 60000
* - `vfs.gcs.endpoint` <br>
* The GCS endpoint. <br>
* **Default**: ""
* - `vfs.gcs.project_id` <br>
* Set the GCS project ID to create new buckets to. Not required unless you
* are going to use the VFS to create buckets. <br>
Expand Down
Loading

0 comments on commit f0ea81e

Please sign in to comment.