MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / loadCertsIntoLocalCouchbaseServer

Function loadCertsIntoLocalCouchbaseServer

rest/x509_utils_test.go:292–309  ·  view source on GitHub ↗

loadCertsIntoLocalCouchbaseServer will upload the given certs into Couchbase Server (via SSH and the REST API)

(ctx context.Context, couchbaseServerURL url.URL, ca *caPair, node *nodePair, localMacOSUser string)

Source from the content-addressed store, hash-verified

290
291// loadCertsIntoLocalCouchbaseServer will upload the given certs into Couchbase Server (via SSH and the REST API)
292func loadCertsIntoLocalCouchbaseServer(ctx context.Context, couchbaseServerURL url.URL, ca *caPair, node *nodePair, localMacOSUser string) error {
293
294 localMacOSCouchbaseServerInbox := "/Users/" + localMacOSUser + "/Library/Application Support/Couchbase/var/lib/couchbase/inbox"
295
296 // Copy node cert and key
297 err := copyLocalFile(node.PEMFilepath, localMacOSCouchbaseServerInbox)
298 if err != nil {
299 return err
300 }
301 base.DebugfCtx(ctx, base.KeyAll, "copied x509 node chain.pem to integration test server")
302
303 err = copyLocalFile(node.KeyFilePath, localMacOSCouchbaseServerInbox)
304 if err != nil {
305 return err
306 }
307 base.DebugfCtx(ctx, base.KeyAll, "copied x509 node pkey.key to integration test server")
308 return uploadCACertViaREST(ctx, couchbaseServerURL, ca)
309}
310
311func uploadCACertViaREST(ctx context.Context, couchbaseServerURL url.URL, ca *caPair) error {
312 restAPIURL := basicAuthRESTPIURLFromConnstrHost(couchbaseServerURL)

Callers 1

setupX509TestsFunction · 0.85

Calls 3

DebugfCtxFunction · 0.92
copyLocalFileFunction · 0.85
uploadCACertViaRESTFunction · 0.85

Tested by

no test coverage detected