Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 96b5b05

Browse files
committed
Add env var input for par subject/issuer
1 parent 62c0f52 commit 96b5b05

File tree

3 files changed

+56
-16
lines changed

3 files changed

+56
-16
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wash-cli"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
authors = ["Brooks Townsend <[email protected]>"]
55
edition = "2018"
66
repository = "https://github.com/wascc/wash"

src/claims.rs

+28-8
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,22 @@ enum TokenCommand {
107107

108108
#[derive(Debug, Clone, StructOpt, Serialize, Deserialize)]
109109
struct GenerateCommon {
110-
/// Path to issuer seed key. If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
111-
#[structopt(short = "i", long = "issuer")]
110+
/// Path to issuer seed key (account). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
111+
#[structopt(
112+
short = "i",
113+
long = "issuer",
114+
env = "WASH_ISSUER_KEY",
115+
hide_env_values = true
116+
)]
112117
issuer: Option<String>,
113118

114-
/// Path to subject seed key. If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
115-
#[structopt(short = "u", long = "subject")]
119+
/// Path to subject seed key (service). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
120+
#[structopt(
121+
short = "s",
122+
long = "subject",
123+
env = "WASH_SUBJECT_KEY",
124+
hide_env_values = true
125+
)]
116126
subject: Option<String>,
117127

118128
/// Location of key files for signing. Defaults to $WASH_KEYS ($HOME/.wash/keys)
@@ -192,12 +202,22 @@ struct ProviderMetadata {
192202
#[structopt(short = "e", long = "version")]
193203
version: Option<String>,
194204

195-
/// Seed path for the issuer
196-
#[structopt(short = "i", long = "issuer")]
205+
/// Path to issuer seed key (account). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
206+
#[structopt(
207+
short = "i",
208+
long = "issuer",
209+
env = "WASH_ISSUER_KEY",
210+
hide_env_values = true
211+
)]
197212
issuer: String,
198213

199-
/// Seed path for the subject
200-
#[structopt(short = "s", long = "subject")]
214+
/// Path to subject seed key (service). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
215+
#[structopt(
216+
short = "s",
217+
long = "subject",
218+
env = "WASH_SUBJECT_KEY",
219+
hide_env_values = true
220+
)]
201221
subject: String,
202222

203223
/// Indicates the token expires in the given amount of days. If this option is left off, the token will never expire

src/par.rs

+27-7
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,22 @@ struct CreateCommand {
6161
)]
6262
directory: Option<String>,
6363

64-
/// Path to issuer seed key (account) If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
65-
#[structopt(short = "i", long = "issuer")]
64+
/// Path to issuer seed key (account). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
65+
#[structopt(
66+
short = "i",
67+
long = "issuer",
68+
env = "WASH_ISSUER_KEY",
69+
hide_env_values = true
70+
)]
6671
issuer: Option<String>,
6772

68-
/// Path to subject seed key (service) If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
69-
#[structopt(short = "s", long = "subject")]
73+
/// Path to subject seed key (service). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
74+
#[structopt(
75+
short = "s",
76+
long = "subject",
77+
env = "WASH_SUBJECT_KEY",
78+
hide_env_values = true
79+
)]
7080
subject: Option<String>,
7181

7282
/// Name of the capability provider
@@ -124,12 +134,22 @@ struct InsertCommand {
124134
)]
125135
directory: Option<String>,
126136

127-
/// Path to issuer seed key (account.) If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
128-
#[structopt(short = "i", long = "issuer")]
137+
/// Path to issuer seed key (account). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
138+
#[structopt(
139+
short = "i",
140+
long = "issuer",
141+
env = "WASH_ISSUER_KEY",
142+
hide_env_values = true
143+
)]
129144
issuer: Option<String>,
130145

131146
/// Path to subject seed key (service). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
132-
#[structopt(short = "s", long = "subject")]
147+
#[structopt(
148+
short = "s",
149+
long = "subject",
150+
env = "WASH_SUBJECT_KEY",
151+
hide_env_values = true
152+
)]
133153
subject: Option<String>,
134154

135155
/// Disables autogeneration of signing keys

0 commit comments

Comments
 (0)