Skip to content

Commit

Permalink
suggested changes added
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhikhapare committed Jun 29, 2023
1 parent b58afee commit d43d078
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions plugins/upstash/api_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func APIKey() schema.CredentialType {
Charset: schema.Charset{
Lowercase: true,
Digits: true,
Symbols: true,
},
},
},
Expand Down
10 changes: 5 additions & 5 deletions plugins/upstash/api_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ func TestAPIKeyProvisioner(t *testing.T) {
"default": {
ItemFields: map[sdk.FieldName]string{
fieldname.APIKey: "d68850db-69f7-qxe9pubcmjnqfgyexample",
fieldname.Email: "fakememail12@gmail.com",
fieldname.Email: "wendy@appleseed.com",
},
ExpectedOutput: sdk.ProvisionOutput{
Environment: map[string]string{
"UPSTASH_API_KEY": "d68850db-69f7-qxe9pubcmjnqfgyexample",
"UPSTASH_EMAIL": "fakememail12@gmail.com",
"UPSTASH_EMAIL": "wendy@appleseed.com",

Check failure on line 21 in plugins/upstash/api_key_test.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofmt`-ed with `-s` (gofmt)
},
},
},
Expand All @@ -30,13 +30,13 @@ func TestAPIKeyImporter(t *testing.T) {
"environment": {
Environment: map[string]string{
"UPSTASH_API_KEY": "d68850db-69f7-qxe9pubcmjnqfgyexample",
"UPSTASH_EMAIL": "fakememail12@gmail.com",
"UPSTASH_EMAIL": "wendy@appleseed.com",
},
ExpectedCandidates: []sdk.ImportCandidate{
{
Fields: map[sdk.FieldName]string{
fieldname.APIKey: "d68850db-69f7-qxe9pubcmjnqfgyexample",
fieldname.Email: "fakememail12@gmail.com",
fieldname.Email: "wendy@appleseed.com",
},
},
},
Expand All @@ -50,7 +50,7 @@ func TestAPIKeyImporter(t *testing.T) {
{
Fields: map[sdk.FieldName]string{
fieldname.APIKey: "d68850db-69f7-qxe9pubcmjnqfgyexample",
fieldname.Email: "fakememail12@gmail.com",
fieldname.Email: "wendy@appleseed.com",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/upstash/test-fixtures/.upstash.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"apiKey":"d68850db-69f7-qxe9pubcmjnqfgyexample",
"email" : "fakememail12@gmail.com"
"email" : "wendy@appleseed.com"
}
3 changes: 2 additions & 1 deletion plugins/upstash/upstash.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ func UpstashCLI() schema.Executable {
NeedsAuth: needsauth.IfAll(
needsauth.NotForHelpOrVersion(),
needsauth.NotWithoutArgs(),
needsauth.NotForExactArgs("config"),
needsauth.NotWhenContainsArgs("--config"),
needsauth.NotWhenContainsArgs("-c"),
needsauth.NotWhenContainsArgs("auth"),
),
Uses: []schema.CredentialUsage{
Expand Down

0 comments on commit d43d078

Please sign in to comment.