Skip to content

Commit a39bfd9

Browse files
committed
[cli] internal: add support for secrets from config file
1 parent 382c4de commit a39bfd9

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

cli/src/Core/Types/Mnemonics/Options.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ walletPassphraseCommon =
6060
"ANTI_WALLET_PASSPHRASE"
6161
"PASSPHRASE"
6262
"ask-wallet-passphrase"
63+
"walletPassphrase"
6364

6465
walletFileOption :: Parser FilePath
6566
walletFileOption =

cli/src/Lib/Options/Secrets.hs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Data.Functor (($>))
66
import OptEnvConf
77
( Alternative ((<|>))
88
, Parser
9+
, conf
910
, env
1011
, help
1112
, long
@@ -35,8 +36,10 @@ secretsParser
3536
-- ^ Metavar string
3637
-> String
3738
-- ^ Long option name
39+
-> String
40+
-- ^ conf json field name
3841
-> Parser String
39-
secretsParser prompt helpString envString metaString longString =
42+
secretsParser prompt helpString envString metaString longString jsonField =
4043
mapIO id
4144
$ setting
4245
[ help helpString
@@ -50,12 +53,14 @@ secretsParser prompt helpString envString metaString longString =
5053
, long longString
5154
, switch $ queryConsole prompt
5255
]
53-
<|> setting
54-
[ env envString
55-
, metavar metaString
56-
, help prompt
57-
, reader $ fmap pure str
58-
]
56+
<|> pure
57+
<$> setting
58+
[ env envString
59+
, metavar metaString
60+
, help prompt
61+
, reader str
62+
, conf jsonField
63+
]
5964

6065
queryConsole :: String -> IO String
6166
queryConsole prompt = runInputT defaultSettings $ do

cli/src/Options.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ githubAuthOption =
7171
"ANTI_GITHUB_PAT"
7272
"GITHUB_PAT"
7373
"ask-github-pat"
74+
"githubPAT"
7475

7576
commandParser :: Parser (Box Command)
7677
commandParser =

cli/src/User/Agent/Options.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ emailResultsOptions =
116116
"ANTI_AGENT_EMAIL_PASSWORD"
117117
"EMAIL_PASSWORD"
118118
"ask-agent-email-password"
119+
"agentEmailPassword"
119120
)
120121
<*> testRunIdOption "check results for"
121122
<*> setting
@@ -153,6 +154,7 @@ slackOption =
153154
"ANTI_SLACK_WEBHOOK"
154155
"SLACK_WEBHOOK"
155156
"ask-slack-webhook"
157+
"slackWebhook"
156158

157159
registryOption :: Parser Registry
158160
registryOption =
@@ -174,6 +176,7 @@ antithesisAuthOption =
174176
"ANTI_ANTITHESIS_PASSWORD"
175177
"PASSWORD"
176178
"ask-antithesis-password"
179+
"antithesisPassword"
177180
where
178181
cardanoWithPwd pwd =
179182
AntithesisAuth{username = "cardano", password = pwd}

cli/src/User/Requester/Options.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ keyPasswordOption =
171171
"The passphrase for the SSH private key"
172172
"ANTI_SSH_PASSWORD"
173173
"PASSWORD"
174-
"ask-ssh-passphrase"
174+
"ask-ssh-password"
175+
"sshPassword"
175176

176177
requestTestOptions
177178
:: Parser

0 commit comments

Comments
 (0)