MCPcopy Create free account
hub / github.com/apache/arrow / GenerateCertificateFile

Method GenerateCertificateFile

cpp/src/arrow/filesystem/s3_test_util.cc:88–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86std::string MinioTestServer::scheme() const { return impl_->scheme_; }
87
88Status MinioTestServer::GenerateCertificateFile() {
89 // create the dedicated folder for certificate file, rather than reuse the data
90 // folder, since there is test case to check whether the folder is empty.
91 ARROW_ASSIGN_OR_RAISE(impl_->temp_dir_ca_, TemporaryDir::Make("s3fs-test-ca-"));
92
93 ARROW_ASSIGN_OR_RAISE(auto public_crt_file,
94 PlatformFilename::FromString(ca_dir_path() + "/public.crt"));
95 ARROW_ASSIGN_OR_RAISE(auto public_cert_fd, FileOpenWritable(public_crt_file));
96 ARROW_RETURN_NOT_OK(FileWrite(public_cert_fd.fd(),
97 reinterpret_cast<const uint8_t*>(kMinioCert),
98 strlen(kMinioCert)));
99 ARROW_RETURN_NOT_OK(public_cert_fd.Close());
100
101 ARROW_ASSIGN_OR_RAISE(auto private_key_file,
102 PlatformFilename::FromString(ca_dir_path() + "/private.key"));
103 ARROW_ASSIGN_OR_RAISE(auto private_key_fd, FileOpenWritable(private_key_file));
104 ARROW_RETURN_NOT_OK(FileWrite(private_key_fd.fd(),
105 reinterpret_cast<const uint8_t*>(kMinioPrivateKey),
106 strlen(kMinioPrivateKey)));
107 ARROW_RETURN_NOT_OK(private_key_fd.Close());
108
109 return Status::OK();
110}
111
112Status MinioTestServer::Start(bool enable_tls) {
113 const char* connect_str = std::getenv(kEnvConnectString);

Callers

nothing calls this directly

Calls 6

FileWriteFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
fdMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected