|
@@ -547,7 +547,7 @@ public:
|
|
|
throw Client::PermissionDenied("access denied: get");
|
|
throw Client::PermissionDenied("access denied: get");
|
|
|
}
|
|
}
|
|
|
spdlog::error("Client::get failed: {}", status.error_message());
|
|
spdlog::error("Client::get failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!response.found()) {
|
|
if (!response.found()) {
|
|
@@ -932,7 +932,7 @@ public:
|
|
|
throw Client::PermissionDenied("access denied: exists");
|
|
throw Client::PermissionDenied("access denied: exists");
|
|
|
}
|
|
}
|
|
|
spdlog::error("Client::exists failed: {}", status.error_message());
|
|
spdlog::error("Client::exists failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return response.exists();
|
|
return response.exists();
|
|
@@ -984,7 +984,7 @@ public:
|
|
|
// caller bug, and returning {} here is indistinguishable from a
|
|
// caller bug, and returning {} here is indistinguishable from a
|
|
|
// legitimately empty result. Since v2.12.4 every other failure
|
|
// legitimately empty result. Since v2.12.4 every other failure
|
|
|
// throws too (below).
|
|
// throws too (below).
|
|
|
- throwStatus(status, status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
// v2.8.0 — a permission denial must NOT look like "no data".
|
|
// v2.8.0 — a permission denial must NOT look like "no data".
|
|
@@ -997,7 +997,7 @@ public:
|
|
|
throw Client::PermissionDenied("access denied: find");
|
|
throw Client::PermissionDenied("access denied: find");
|
|
|
}
|
|
}
|
|
|
spdlog::error("Client::find failed: {}", status.error_message());
|
|
spdlog::error("Client::find failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
std::vector<nlohmann::json> results;
|
|
std::vector<nlohmann::json> results;
|
|
@@ -1047,7 +1047,7 @@ public:
|
|
|
|
|
|
|
|
auto status = stub_->Find(&context, request, &response);
|
|
auto status = stub_->Find(&context, request, &response);
|
|
|
if (status.error_code() == grpc::StatusCode::NOT_FOUND) {
|
|
if (status.error_code() == grpc::StatusCode::NOT_FOUND) {
|
|
|
- throwStatus(status, status.error_message()); // see find()
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // see find()
|
|
|
}
|
|
}
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
// v2.8.0 — a permission denial must NOT look like "no data".
|
|
// v2.8.0 — a permission denial must NOT look like "no data".
|
|
@@ -1060,7 +1060,7 @@ public:
|
|
|
throw Client::PermissionDenied("access denied: findWithMetrics");
|
|
throw Client::PermissionDenied("access denied: findWithMetrics");
|
|
|
}
|
|
}
|
|
|
spdlog::error("Client::findWithMetrics failed: {}", status.error_message());
|
|
spdlog::error("Client::findWithMetrics failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Client::FindResult result;
|
|
Client::FindResult result;
|
|
@@ -1115,7 +1115,7 @@ public:
|
|
|
throw Client::PermissionDenied("access denied: count");
|
|
throw Client::PermissionDenied("access denied: count");
|
|
|
}
|
|
}
|
|
|
spdlog::error("Client::count failed: {}", status.error_message());
|
|
spdlog::error("Client::count failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return response.count();
|
|
return response.count();
|
|
@@ -1173,7 +1173,7 @@ public:
|
|
|
auto status = stub_->SetMembers(&context, request, &response);
|
|
auto status = stub_->SetMembers(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::setMembers failed: {}", status.error_message());
|
|
spdlog::error("Client::setMembers failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return {response.members().begin(), response.members().end()};
|
|
return {response.members().begin(), response.members().end()};
|
|
@@ -1192,7 +1192,7 @@ public:
|
|
|
auto status = stub_->SetIsMember(&context, request, &response);
|
|
auto status = stub_->SetIsMember(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::setIsMember failed: {}", status.error_message());
|
|
spdlog::error("Client::setIsMember failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return response.is_member();
|
|
return response.is_member();
|
|
@@ -1236,7 +1236,7 @@ public:
|
|
|
auto status = stub_->SimilaritySearch(&context, request, &response);
|
|
auto status = stub_->SimilaritySearch(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::similaritySearch failed: {}", status.error_message());
|
|
spdlog::error("Client::similaritySearch failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
// v2.14.0 - a pre-2.14.0 server ignores the filters and ranks the
|
|
// v2.14.0 - a pre-2.14.0 server ignores the filters and ranks the
|
|
|
// whole collection. Those rows look exactly like a filtered answer, so
|
|
// whole collection. Those rows look exactly like a filtered answer, so
|
|
@@ -1336,7 +1336,7 @@ public:
|
|
|
auto status = stub_->ListCollections(&context, request, &response);
|
|
auto status = stub_->ListCollections(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listCollections failed: {}", status.error_message());
|
|
spdlog::error("Client::listCollections failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// v2.4.5 — round-trip the naming: callers pass bare names in, so they
|
|
// v2.4.5 — round-trip the naming: callers pass bare names in, so they
|
|
@@ -1366,7 +1366,7 @@ public:
|
|
|
auto status = stub_->GetCollectionInfo(&context, request, &response);
|
|
auto status = stub_->GetCollectionInfo(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getCollectionInfo failed: {}", status.error_message());
|
|
spdlog::error("Client::getCollectionInfo failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!response.found()) {
|
|
if (!response.found()) {
|
|
@@ -1397,7 +1397,7 @@ public:
|
|
|
auto status = stub_->ListProjects(&context, request, &response);
|
|
auto status = stub_->ListProjects(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listProjects failed: {}", status.error_message());
|
|
spdlog::error("Client::listProjects failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
return {response.projects().begin(), response.projects().end()};
|
|
return {response.projects().begin(), response.projects().end()};
|
|
|
}
|
|
}
|
|
@@ -1413,7 +1413,7 @@ public:
|
|
|
auto status = stub_->CreateProject(&context, request, &response);
|
|
auto status = stub_->CreateProject(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::createProject failed: {}", status.error_message());
|
|
spdlog::error("Client::createProject failed: {}", status.error_message());
|
|
|
- throwStatus(status, "createProject transport failure: " + status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, "createProject transport failure: " + status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
if (!response.error().empty()) {
|
|
if (!response.error().empty()) {
|
|
|
// Validation error (invalid name etc.) — surfaced via the
|
|
// Validation error (invalid name etc.) — surfaced via the
|
|
@@ -1435,7 +1435,7 @@ public:
|
|
|
auto status = stub_->DropProject(&context, request, &response);
|
|
auto status = stub_->DropProject(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::dropProject failed: {}", status.error_message());
|
|
spdlog::error("Client::dropProject failed: {}", status.error_message());
|
|
|
- throwStatus(status, "dropProject transport failure: " + status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, "dropProject transport failure: " + status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
if (!response.error().empty()) {
|
|
if (!response.error().empty()) {
|
|
|
throw std::runtime_error("dropProject('" + name + "') refused: " +
|
|
throw std::runtime_error("dropProject('" + name + "') refused: " +
|
|
@@ -1485,7 +1485,7 @@ public:
|
|
|
auto status = stub_->GetCollectionConfig(&context, request, &response);
|
|
auto status = stub_->GetCollectionConfig(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getCollectionConfig failed: {}", status.error_message());
|
|
spdlog::error("Client::getCollectionConfig failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
out.timestampPrecision = response.config().timestamp_precision();
|
|
out.timestampPrecision = response.config().timestamp_precision();
|
|
|
if (out.timestampPrecision.empty()) out.timestampPrecision = "ms";
|
|
if (out.timestampPrecision.empty()) out.timestampPrecision = "ms";
|
|
@@ -1510,7 +1510,7 @@ public:
|
|
|
auto status = stub_->GetCollectionConfig(&context, request, &response);
|
|
auto status = stub_->GetCollectionConfig(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::hasCollectionConfig failed: {}", status.error_message());
|
|
spdlog::error("Client::hasCollectionConfig failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
return response.found();
|
|
return response.found();
|
|
|
}
|
|
}
|
|
@@ -1752,6 +1752,41 @@ public:
|
|
|
return out;
|
|
return out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Client::EncryptionReport verifyEncryption(const std::string& collection) {
|
|
|
|
|
+ requireCapability(Client::Capability::kEncryptionAtRest, "verifyEncryption");
|
|
|
|
|
+ smartbotic::databasepb::VerifyEncryptionRequest request;
|
|
|
|
|
+ if (!collection.empty()) request.set_collection(qualify(collection));
|
|
|
|
|
+ smartbotic::databasepb::VerifyEncryptionResponse response;
|
|
|
|
|
+ grpc::ClientContext context;
|
|
|
|
|
+ // A full scan of every collection and its history.
|
|
|
|
|
+ context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(600));
|
|
|
|
|
+ attachAuth(context);
|
|
|
|
|
+ auto status = stub_->VerifyEncryption(&context, request, &response);
|
|
|
|
|
+ if (!status.ok()) {
|
|
|
|
|
+ throwStatus(status, "verifyEncryption: " + status.error_message(), trailerDetail(context));
|
|
|
|
|
+ }
|
|
|
|
|
+ Client::EncryptionReport out;
|
|
|
|
|
+ out.encryptionEnabled = response.encryption_enabled();
|
|
|
|
|
+ out.atRestSealed = response.at_rest_sealed();
|
|
|
|
|
+ for (const auto& a : response.collections()) {
|
|
|
|
|
+ Client::EncryptionAudit e;
|
|
|
|
|
+ e.collection = a.collection();
|
|
|
|
|
+ e.collectionEncrypted = a.collection_encrypted();
|
|
|
|
|
+ e.sensitiveFields.assign(a.sensitive_fields().begin(), a.sensitive_fields().end());
|
|
|
|
|
+ e.rows = a.rows();
|
|
|
|
|
+ e.encryptedValues = a.encrypted_values();
|
|
|
|
|
+ e.plaintextRequired = a.plaintext_required();
|
|
|
|
|
+ e.doubleEncrypted = a.double_encrypted();
|
|
|
|
|
+ e.undecryptable = a.undecryptable();
|
|
|
|
|
+ e.historyVersions = a.history_versions();
|
|
|
|
|
+ e.historyPlaintextRequired = a.history_plaintext_required();
|
|
|
|
|
+ e.historyDoubleEncrypted = a.history_double_encrypted();
|
|
|
|
|
+ e.samples.assign(a.samples().begin(), a.samples().end());
|
|
|
|
|
+ out.collections.push_back(std::move(e));
|
|
|
|
|
+ }
|
|
|
|
|
+ return out;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// ===== Collection schema (v2.16.0) =====
|
|
// ===== Collection schema (v2.16.0) =====
|
|
|
|
|
|
|
|
Client::SchemaChangeResult schemaChange(const std::string& collection, const std::string& schemaJson,
|
|
Client::SchemaChangeResult schemaChange(const std::string& collection, const std::string& schemaJson,
|
|
@@ -1847,7 +1882,7 @@ public:
|
|
|
auto status = stub_->ListIndexes(&context, request, &response);
|
|
auto status = stub_->ListIndexes(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listIndexes failed: {}", status.error_message());
|
|
spdlog::error("Client::listIndexes failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
out.reserve(response.indexes_size());
|
|
out.reserve(response.indexes_size());
|
|
|
if (uniqueFlags != nullptr) {
|
|
if (uniqueFlags != nullptr) {
|
|
@@ -1929,7 +1964,7 @@ public:
|
|
|
auto status = stub_->ListIndexes(&context, request, &response);
|
|
auto status = stub_->ListIndexes(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listCompositeUniqueIndexes failed: {}", status.error_message());
|
|
spdlog::error("Client::listCompositeUniqueIndexes failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
for (const auto& i : response.indexes()) {
|
|
for (const auto& i : response.indexes()) {
|
|
|
if (i.fields_size() > 0) out.emplace_back(i.fields().begin(), i.fields().end());
|
|
if (i.fields_size() > 0) out.emplace_back(i.fields().begin(), i.fields().end());
|
|
@@ -1953,7 +1988,7 @@ public:
|
|
|
auto status = stub_->GetIndexValues(&context, request, &response);
|
|
auto status = stub_->GetIndexValues(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::indexValues failed: {}", status.error_message());
|
|
spdlog::error("Client::indexValues failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
out.reserve(response.values_size());
|
|
out.reserve(response.values_size());
|
|
|
for (const auto& v : response.values()) {
|
|
for (const auto& v : response.values()) {
|
|
@@ -1996,7 +2031,7 @@ public:
|
|
|
auto status = stub_->ListViews(&context, request, &response);
|
|
auto status = stub_->ListViews(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listViews failed: {}", status.error_message());
|
|
spdlog::error("Client::listViews failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
for (const auto& pb : response.views()) {
|
|
for (const auto& pb : response.views()) {
|
|
|
Client::ViewDefinition v;
|
|
Client::ViewDefinition v;
|
|
@@ -2036,7 +2071,7 @@ public:
|
|
|
auto status = stub_->GetViewInfo(&context, request, &response);
|
|
auto status = stub_->GetViewInfo(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getViewInfo failed: {}", status.error_message());
|
|
spdlog::error("Client::getViewInfo failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
if (!response.found()) {
|
|
if (!response.found()) {
|
|
|
return std::nullopt;
|
|
return std::nullopt;
|
|
@@ -2155,7 +2190,7 @@ public:
|
|
|
auto status = stub_->ListRelations(&context, request, &response);
|
|
auto status = stub_->ListRelations(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listRelations failed: {}", status.error_message());
|
|
spdlog::error("Client::listRelations failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
out.reserve(response.relations_size());
|
|
out.reserve(response.relations_size());
|
|
|
for (const auto& pb : response.relations()) {
|
|
for (const auto& pb : response.relations()) {
|
|
@@ -2174,7 +2209,7 @@ public:
|
|
|
auto status = stub_->GetRelationInfo(&context, request, &response);
|
|
auto status = stub_->GetRelationInfo(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getRelationInfo failed: {}", status.error_message());
|
|
spdlog::error("Client::getRelationInfo failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
if (!response.found()) {
|
|
if (!response.found()) {
|
|
|
return std::nullopt;
|
|
return std::nullopt;
|
|
@@ -2519,7 +2554,7 @@ public:
|
|
|
auto status = stub_->GetVersionHistory(&context, request, &response);
|
|
auto status = stub_->GetVersionHistory(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getVersionHistory failed: {}", status.error_message());
|
|
spdlog::error("Client::getVersionHistory failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Client::VersionHistoryResult result;
|
|
Client::VersionHistoryResult result;
|
|
@@ -2556,7 +2591,7 @@ public:
|
|
|
auto status = stub_->GetDocumentVersion(&context, request, &response);
|
|
auto status = stub_->GetDocumentVersion(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::getDocumentVersion failed: {}", status.error_message());
|
|
spdlog::error("Client::getDocumentVersion failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message()); // v2.12.4: never empty on failure
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context)); // v2.12.4: never empty on failure
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!response.found()) {
|
|
if (!response.found()) {
|
|
@@ -2870,7 +2905,7 @@ public:
|
|
|
auto status = reader->Finish();
|
|
auto status = reader->Finish();
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::downloadFile failed: {}", status.error_message());
|
|
spdlog::error("Client::downloadFile failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
return fileData;
|
|
return fileData;
|
|
|
}
|
|
}
|
|
@@ -2888,7 +2923,7 @@ public:
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
if (status.error_code() == grpc::StatusCode::NOT_FOUND) return std::nullopt;
|
|
if (status.error_code() == grpc::StatusCode::NOT_FOUND) return std::nullopt;
|
|
|
spdlog::error("Client::getFileInfo failed: {}", status.error_message());
|
|
spdlog::error("Client::getFileInfo failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Client::FileRecord record;
|
|
Client::FileRecord record;
|
|
@@ -2980,7 +3015,7 @@ public:
|
|
|
auto status = stub_->ListFiles(&context, request, &response);
|
|
auto status = stub_->ListFiles(&context, request, &response);
|
|
|
if (!status.ok()) {
|
|
if (!status.ok()) {
|
|
|
spdlog::error("Client::listFiles failed: {}", status.error_message());
|
|
spdlog::error("Client::listFiles failed: {}", status.error_message());
|
|
|
- throwStatus(status, status.error_message());
|
|
|
|
|
|
|
+ throwStatus(status, status.error_message(), trailerDetail(context));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Client::FileListResult result;
|
|
Client::FileListResult result;
|
|
@@ -3641,6 +3676,10 @@ Client::FileListResult Client::listFiles(const std::string& file_type,
|
|
|
#define SMARTBOTIC_DB_GIT_COMMIT_STRING "unknown"
|
|
#define SMARTBOTIC_DB_GIT_COMMIT_STRING "unknown"
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+Client::EncryptionReport Client::verifyEncryption(const std::string& collection) {
|
|
|
|
|
+ return impl_->verifyEncryption(collection);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
Client::SchemaChangeResult Client::setCollectionSchema(const std::string& collection,
|
|
Client::SchemaChangeResult Client::setCollectionSchema(const std::string& collection,
|
|
|
const nlohmann::json& schema,
|
|
const nlohmann::json& schema,
|
|
|
SchemaMode mode) {
|
|
SchemaMode mode) {
|