Skip to content

Commit 2dcf34a

Browse files
committed
Recommited with sign
1 parent 983a1ee commit 2dcf34a

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

plugins/yugabytedb/database_credentials.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package yugabytedb
22

33
import (
4-
"context"
5-
64
"github.com/1Password/shell-plugins/sdk"
75
"github.com/1Password/shell-plugins/sdk/importer"
86
"github.com/1Password/shell-plugins/sdk/provision"
@@ -14,8 +12,8 @@ import (
1412
func DatabaseCredentials() schema.CredentialType {
1513
return schema.CredentialType{
1614
Name: credname.DatabaseCredentials,
17-
DocsURL: sdk.URL("https://docs.yugabyte.com/preview/admin/ysqlsh/#connect-to-a-database"),
18-
ManagementURL: sdk.URL("https://cloud.yugabyte.com/"),
15+
DocsURL: sdk.URL("https://docs.yugabyte.com/preview/admin/ysqlsh/#connect-to-a-database"),
16+
ManagementURL: sdk.URL("https://cloud.yugabyte.com/clusters"),
1917
Fields: []schema.CredentialField{
2018
{
2119
Name: fieldname.Host,
@@ -27,8 +25,8 @@ func DatabaseCredentials() schema.CredentialType {
2725
Optional: true,
2826
},
2927
{
30-
Name: fieldname.User,
31-
MarkdownDescription: "Yugabyte user to authenticate as.",
28+
Name: fieldname.Username,
29+
MarkdownDescription: "Yugabyte user to get authenticate.",
3230
},
3331
{
3432
Name: fieldname.Password,
@@ -37,18 +35,19 @@ func DatabaseCredentials() schema.CredentialType {
3735
},
3836
{
3937
Name: fieldname.Database,
40-
MarkdownDescription: "Database name to connect to.",
38+
MarkdownDescription: "Database name to connect to Yugabyte.",
4139
Optional: true,
4240
},
4341
},
4442
DefaultProvisioner: provision.EnvVars(defaultEnvVarMapping),
4543
Importer: importer.TryEnvVarPair(defaultEnvVarMapping),
4644
}
4745
}
46+
4847
var defaultEnvVarMapping = map[string]sdk.FieldName{
4948
"PGHOST": fieldname.Host,
5049
"PGPORT": fieldname.Port,
51-
"PGUSER": fieldname.User,
50+
"PGUSER": fieldname.Username,
5251
"PGPASSWORD": fieldname.Password,
5352
"PGDATABASE": fieldname.Database,
5453
}

plugins/yugabytedb/database_credentials_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestDatabaseCredentialsImporter(t *testing.T) {
1212
plugintest.TestImporter(t, DatabaseCredentials().Importer, map[string]plugintest.ImportCase{
13-
"default": {
13+
"yugabyte": {
1414
Environment: map[string]string{
1515
"PGHOST": "localhost",
1616
"PGPORT": "5432",
@@ -23,7 +23,7 @@ func TestDatabaseCredentialsImporter(t *testing.T) {
2323
Fields: map[sdk.FieldName]string{
2424
fieldname.Host: "localhost",
2525
fieldname.Port: "5432",
26-
fieldname.User: "root",
26+
fieldname.Username: "root",
2727
fieldname.Password: "123456",
2828
fieldname.Database: "test",
2929
},
@@ -39,7 +39,7 @@ func TestDatabaseCredentialsProvisioner(t *testing.T) {
3939
ItemFields: map[sdk.FieldName]string{
4040
fieldname.Host: "localhost",
4141
fieldname.Port: "5432",
42-
fieldname.User: "root",
42+
fieldname.Username: "root",
4343
fieldname.Password: "123456",
4444
fieldname.Database: "test",
4545
},
@@ -53,5 +53,6 @@ func TestDatabaseCredentialsProvisioner(t *testing.T) {
5353
},
5454
},
5555
},
56-
})
56+
},
57+
)
5758
}

plugins/yugabytedb/ysqlsh.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ import (
99

1010
func YugabyteDBCLI() schema.Executable {
1111
return schema.Executable{
12-
Name: "YugabyteDB SQL Shell",
13-
Runs: []string{"ysqlsh"},
14-
DocsURL: sdk.URL("https://docs.yugabyte.com/preview/admin/ysqlsh/"),
12+
Name: "YugabyteDB SQL Shell",
13+
Runs: []string{"ysqlsh"},
14+
DocsURL: sdk.URL("https://docs.yugabyte.com/preview/admin/ysqlsh/"),
1515
NeedsAuth: needsauth.IfAll(
1616
needsauth.NotForHelpOrVersion(),
17-
needsauth.NotWithoutArgs(),
1817
),
1918
Uses: []schema.CredentialUsage{
2019
{

0 commit comments

Comments
 (0)