Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/postgres: add inline certificate authentication fields #28024

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert back to errwrap since the middleware sanitizing depends on it
  • Loading branch information
fairclothjm committed Aug 8, 2024
commit 6aaa8e4e590f625e094a00dd9696a4a6b5cf21d0
2 changes: 2 additions & 0 deletions builtin/logical/database/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ func TestBackend_config_connection(t *testing.T) {
assert.Equal(t, "plugin-test", eventSender.Events[2].Event.Metadata.AsMap()["name"])
}

// TestBackend_BadConnectionString tests that an error response resulting from
// a failed connection does not expose the URL. The middleware should sanitize it.
func TestBackend_BadConnectionString(t *testing.T) {
cluster, sys := getClusterPostgresDB(t)
defer cluster.Cleanup()
Expand Down
4 changes: 2 additions & 2 deletions sdk/database/helper/connutil/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ func (c *SQLConnectionProducer) Init(ctx context.Context, conf map[string]interf

if verifyConnection {
if _, err := c.Connection(ctx); err != nil {
return nil, fmt.Errorf("error verifying connection: %w", err)
return nil, errwrap.Wrapf("error verifying connection: {{err}}", err)
}

if err := c.db.PingContext(ctx); err != nil {
return nil, fmt.Errorf("error verifying connection: ping failed: %s", err)
return nil, errwrap.Wrapf("error verifying connection: ping failed: {{err}}", err)
}
}

Expand Down
Loading