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

Method setDatabaseCredentials

rest/config.go:449–462  ·  view source on GitHub ↗
(credentials base.CredentialsConfig)

Source from the content-addressed store, hash-verified

447}
448
449func (dbConfig *DbConfig) setDatabaseCredentials(credentials base.CredentialsConfig) {
450 // X.509 overrides username/password
451 if credentials.X509CertPath != "" || credentials.X509KeyPath != "" {
452 dbConfig.CertPath = credentials.X509CertPath
453 dbConfig.KeyPath = credentials.X509KeyPath
454 dbConfig.Username = ""
455 dbConfig.Password = ""
456 } else {
457 dbConfig.Username = credentials.Username
458 dbConfig.Password = credentials.Password
459 dbConfig.CertPath = ""
460 dbConfig.KeyPath = ""
461 }
462}
463
464// setup populates fields in the dbConfig
465func (dbConfig *DbConfig) setup(ctx context.Context, dbName string, bootstrapConfig BootstrapConfig, dbCredentials, bucketCredentials *base.CredentialsConfig, forcePerBucketAuth bool) error {

Callers 2

setupMethod · 0.95
FetchConfigsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected