-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ysql database plugin #2
base: main
Are you sure you want to change the base?
Conversation
…t-integrations into ysql-database
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.
LGTM.
ImageRepo: "yugabytedb/yugabyte", | ||
Cmd: []string{"./bin/yugabyted", "start", "--daemon=false"}, | ||
ImageTag: version, | ||
Env: []string{"YSQL_DB=database", "YSQL_PASSWORD=secret"}, |
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.
How about naming the default database as something like testdb
?
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.
Is this referring to ConatinerName
? @jayant07-yb
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.
The database name in this line
Env: []string{"YSQL_DB=database", "YSQL_PASSWORD=secret"},
needs to be changed to
Env: []string{"YSQL_DB= testdb", "YSQL_PASSWORD=secret"},
defaultExpirationStatement = ` | ||
ALTER ROLE "{{name}}" VALID UNTIL '{{expiration}}'; | ||
` |
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.
Nit: Can't we keep the entire string on the same line?
defaultExpirationStatement = `ALTER ROLE ...`
Same for the statement on line 24?
connProducer.Type = yugabyteDBType | ||
|
||
yugabyte := &ysql{ | ||
YugabyteConnectionProducer: connProducer, |
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.
The connProducer
object (that has lock object inside it) is being copied here. This is not recommended. Consider making the named YugabyteConnectionProducer
a pointer field.
// the role | ||
// This isn't done in a transaction because even if we fail along the way, | ||
// we want to remove as much access as possible | ||
stmt, err := db.PrepareContext(ctx, "SELECT DISTINCT table_schema FROM information_schema.role_column_grants WHERE grantee=$1;") |
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.
Replace the query with
SELECT schema_name FROM information_schema.schemata;
Ysql database plugin will allow users for managing the roles for yugabyteDB(ysql) database via the HashiCorp Vault.
Details regarding the implementation are provided here
Details regarding using the plugin are provided here