-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Added PSC Private Service Connect for GCP CloudSQL #27889
base: main
Are you sure you want to change the base?
Changes from 3 commits
49d9118
b90ab8d
acac415
c5fdb98
6743547
1c1e6ae
b6f8f77
4b26678
d862d0b
1cc6299
9bdcb44
b377760
16b564d
f3c8579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
```release-note:improvement | ||
secrets/database: Add PSC support for GCP CloudSQL MySQL and Postgresql also add PrivateIP support for MySQL | ||
secrets/database: Add PSC support for GCP CloudSQL MySQL and Postgresql | ||
``` | ||
```release-note:improvement | ||
secrets/database: Add PrivateIP support for MySQL | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,8 @@ type SQLConnectionProducer struct { | |
MaxIdleConnections int `json:"max_idle_connections" mapstructure:"max_idle_connections" structs:"max_idle_connections"` | ||
MaxConnectionLifetimeRaw interface{} `json:"max_connection_lifetime" mapstructure:"max_connection_lifetime" structs:"max_connection_lifetime"` | ||
DisableEscaping bool `json:"disable_escaping" mapstructure:"disable_escaping" structs:"disable_escaping"` | ||
usePrivateIP bool `json:"use_private_ip" mapstructure:"use_private_ip" structs:"use_private_ip"` | ||
usePSC bool `json:"use_psc" mapstructure:"use_psc" structs:"use_psc"` | ||
UsePrivateIP bool `json:"use_private_ip" mapstructure:"use_private_ip" structs:"use_private_ip"` | ||
UsePSC bool `json:"use_psc" mapstructure:"use_psc" structs:"use_psc"` | ||
Comment on lines
+56
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These will be returned in the READ response for all database plugins that embed this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But this is already the case for
Which is only supported for Postgresql, but still field is available for hana, mssql, redshift There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh actually I was able to remove from the read path, when auth_type is not gcp_iam Test (did the same test with mysql as well)
Write and read using normal plugin and normal auth
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wrong about this. See my comment here https://github.com/hashicorp/vault/pull/27889/files#r1720329947 |
||
|
||
// Username/Password is the default auth type when AuthType is not set | ||
Username string `json:"username" mapstructure:"username" structs:"username"` | ||
|
@@ -152,7 +152,7 @@ func (c *SQLConnectionProducer) Init(ctx context.Context, conf map[string]interf | |
// however, the driver might store a credentials file, in which case the state stored by the driver is in | ||
// fact critical to the proper function of the connection. So it needs to be registered here inside the | ||
// ConnectionProducer init. | ||
dialerCleanup, err := c.registerDrivers(c.cloudDriverName, c.ServiceAccountJSON, c.usePrivateIP, c.usePSC) | ||
dialerCleanup, err := c.registerDrivers(c.cloudDriverName, c.ServiceAccountJSON, c.UsePrivateIP, c.UsePSC) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still want these fields for mysql?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I havee tested them as well.