Skip to content

Commit a3da4cb

Browse files
bala-cegaccraw
authored andcommitted
addressing the review comments
Signed-off-by: Amanda Crawley <[email protected]>
1 parent a888d1c commit a3da4cb

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

plugins/binance/api_key.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ func APIKey() schema.CredentialType {
4343
},
4444
},
4545
DefaultProvisioner: provision.EnvVars(defaultEnvVarMapping),
46-
Importer: importer.TryAll(
47-
importer.TryEnvVarPair(defaultEnvVarMapping),
46+
Importer: importer.TryEnvVarPair(defaultEnvVarMapping,
4847
)}
4948
}
5049

plugins/binance/api_key_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ func TestAPIKeyProvisioner(t *testing.T) {
1313
"default": {
1414
ItemFields: map[sdk.FieldName]string{
1515
fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
16-
fieldname.APISecret: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
16+
fieldname.APISecret: "2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qjThmEycY2J0RgJgNNrWQBqEXAMPLE",
1717
},
1818
ExpectedOutput: sdk.ProvisionOutput{
1919
Environment: map[string]string{
2020
"BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
21-
"BINANCE_API_SECRET": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
21+
"BINANCE_API_SECRET": "2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qjThmEycY2J0RgJgNNrWQBqEXAMPLE",
2222
},
2323
},
2424
},
@@ -30,13 +30,13 @@ func TestAPIKeyImporter(t *testing.T) {
3030
"environment": {
3131
Environment: map[string]string{
3232
"BINANCE_API_KEY": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
33-
"BINANCE_API_SECRET": "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
33+
"BINANCE_API_SECRET": "2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qjThmEycY2J0RgJgNNrWQBqEXAMPLE",
3434
},
3535
ExpectedCandidates: []sdk.ImportCandidate{
3636
{
3737
Fields: map[sdk.FieldName]string{
3838
fieldname.APIKey: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
39-
fieldname.APISecret: "jThmEycY2J0RgJgNNrWQBq2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qEXAMPLE",
39+
fieldname.APISecret: "2raPzKvxCkcwPQFk8AuWUu5QxQSWaItIB1qjThmEycY2J0RgJgNNrWQBqEXAMPLE",
4040
},
4141
},
4242
},

plugins/binance/binance_cli.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ func BinanceCLI() schema.Executable {
1515
NeedsAuth: needsauth.IfAll(
1616
needsauth.NotForHelpOrVersion(),
1717
needsauth.NotWithoutArgs(),
18+
needsauth.NotWhenContainsArgs("t"),
19+
needsauth.NotWhenContainsArgs("i"),
20+
needsauth.NotWhenContainsArgs("book"),
21+
needsauth.NotWhenContainsArgs("at"),
22+
needsauth.NotWhenContainsArgs("k"),
23+
needsauth.NotWhenContainsArgs("ap"),
24+
needsauth.NotWhenContainsArgs("ticker"),
25+
needsauth.NotWhenContainsArgs("price"),
26+
needsauth.NotWhenContainsArgs("bt"),
27+
needsauth.NotWhenContainsArgs("listen"),
1828
),
1929
Uses: []schema.CredentialUsage{
2030
{

0 commit comments

Comments
 (0)