(credentials base.CredentialsConfig)
| 447 | } |
| 448 | |
| 449 | func (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 |
| 465 | func (dbConfig *DbConfig) setup(ctx context.Context, dbName string, bootstrapConfig BootstrapConfig, dbCredentials, bucketCredentials *base.CredentialsConfig, forcePerBucketAuth bool) error { |
no outgoing calls
no test coverage detected