Skip to content

Commit 0591273

Browse files
authored
fix: quick fix on notation cert command help page (#1238)
Signed-off-by: Patrick Zheng <[email protected]>
1 parent d6701dc commit 0591273

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

Diff for: cmd/notation/cert/add.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Example - Add a certificate to the "tsa" type of a named store "timestamp":
5656
return addCerts(opts)
5757
},
5858
}
59-
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority")
59+
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority, tsa")
6060
command.Flags().StringVarP(&opts.namedStore, "store", "s", "", "specify named store")
6161
command.MarkFlagRequired("type")
6262
command.MarkFlagRequired("store")

Diff for: cmd/notation/cert/delete.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Example - Delete certificate "wabbit-networks-timestamp.pem" with "tsa" type fro
6767
return deleteCerts(opts)
6868
},
6969
}
70-
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority")
70+
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority, tsa")
7171
command.Flags().StringVarP(&opts.namedStore, "store", "s", "", "specify named store")
7272
command.Flags().BoolVarP(&opts.all, "all", "a", false, "delete all certificates in the named store")
7373
command.Flags().BoolVarP(&opts.confirmed, "yes", "y", false, "do not prompt for confirmation")

Diff for: cmd/notation/cert/list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Example - List all certificate files from trust store of type "tsa"
6565
},
6666
}
6767
opts.LoggingFlagOpts.ApplyFlags(command.Flags())
68-
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority")
68+
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority, tsa")
6969
command.Flags().StringVarP(&opts.namedStore, "store", "s", "", "specify named store")
7070
return command
7171
}

Diff for: cmd/notation/cert/show.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Example - Show details of certificate "wabbit-networks-timestamp.pem" with type
6666
},
6767
}
6868
opts.LoggingFlagOpts.ApplyFlags(command.Flags())
69-
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority")
69+
command.Flags().StringVarP(&opts.storeType, "type", "t", "", "specify trust store type, options: ca, signingAuthority, tsa")
7070
command.Flags().StringVarP(&opts.namedStore, "store", "s", "", "specify named store")
7171
command.MarkFlagRequired("type")
7272
command.MarkFlagRequired("store")

Diff for: specs/cmd/certificate.md

+23-17
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
Use ```notation certificate``` command to add/list/delete certificates in notation's trust store. Updating an existing certificate is not allowed since the thumbprint will be inconsistent, which results in a new certificate.
66

7-
The trust store is in the format of a directory in the filesystem as`x509/<type>/<name>/*.crt|*.cer|*.pem`. Currently two types of trust store are supported:
7+
The trust store is in the format of a directory in the filesystem as`x509/<type>/<name>/*.crt|*.cer|*.pem`. Currently three types of trust store are supported:
88

9-
* `Certificate Authority`: The directory name is `ca`.
9+
* `Certificate Authority`: The directory name is `ca`
1010
* `Signing Authority`: The directory name is `signingAuthority`
11+
* `Timestamping Authority`: The directory name is `tsa`
1112

1213
There could be more trust store types introduced in the future.
1314

@@ -26,9 +27,13 @@ $XDG_CONFIG_HOME/notation/truststore
2627
/signingAuthority
2728
/wabbit-networks
2829
cert3.crt
30+
31+
/tsa
32+
/trusted-tsa
33+
tsa.crt
2934
```
3035

31-
In this example, there are two certificates stored in trust store named `acme-rockets` of type `ca`. There is one certificate stored in trust store named `wabbit-networks` of type `signingAuthority`.
36+
In this example, there are two certificates stored in trust store named `acme-rockets` of type `ca`. There is one certificate stored in trust store named `wabbit-networks` of type `signingAuthority`. And there is one certificate stored in trust store named `trusted-tsa` of type `tsa`.
3237

3338
## Outline
3439

@@ -66,7 +71,7 @@ Usage:
6671
Flags:
6772
-h, --help help for add
6873
-s, --store string specify named store
69-
-t, --type string specify trust store type, options: ca, signingAuthority
74+
-t, --type string specify trust store type, options: ca, signingAuthority, tsa
7075
```
7176

7277
### notation certificate list
@@ -84,7 +89,7 @@ Flags:
8489
-d, --debug debug mode
8590
-h, --help help for list
8691
-s, --store string specify named store
87-
-t, --type string specify trust store type, options: ca, signingAuthority
92+
-t, --type string specify trust store type, options: ca, signingAuthority, tsa
8893
-v, --verbose verbose mode
8994
```
9095

@@ -100,7 +105,7 @@ Flags:
100105
-d, --debug debug mode
101106
-h, --help help for show
102107
-s, --store string specify named store
103-
-t, --type string specify trust store type, options: ca, signingAuthority
108+
-t, --type string specify trust store type, options: ca, signingAuthority, tsa
104109
-v, --verbose verbose mode
105110
```
106111

@@ -116,7 +121,7 @@ Flags:
116121
-a, --all delete all certificates in the named store
117122
-h, --help help for delete
118123
-s, --store string specify named store
119-
-t, --type string specify trust store type, options: ca, signingAuthority
124+
-t, --type string specify trust store type, options: ca, signingAuthority, tsa
120125
-y, --yes do not prompt for confirmation
121126
```
122127

@@ -169,11 +174,12 @@ Upon successful listing, all the certificate files in the trust store are printe
169174

170175
An example of the output:
171176
```
172-
STORE TYPE STORE NAME CERTIFICATE
173-
ca myStore1 cert1.pem
174-
ca myStore2 cert2.crt
175-
signingAuthority myStore1 cert3.crt
177+
STORE TYPE STORE NAME CERTIFICATE
178+
ca myStore1 cert1.pem
179+
ca myStore2 cert2.crt
180+
signingAuthority myStore1 cert3.crt
176181
signingAuthority myStore2 cert4.pem
182+
tsa myTSA tsa.crt
177183
```
178184
### List all certificate files of a certain named store
179185

@@ -233,7 +239,7 @@ notation certificate delete --type <type> --store <name> <cert_fileName>
233239
A prompt is displayed, asking the user to confirm the deletion. Upon successful deletion, the specific certificate is deleted from the trust store named `<name>` of type `<type>`. The output message is printed out as following:
234240

235241
```text
236-
Successfully deleted <cert_fileName> from the trust store.
242+
Successfully deleted <cert_fileName> from the trust store.
237243
```
238244

239245
If users execute the deletion without specifying required flags using `notation cert delete <cert_fileName>`, the deletion fails and the error output message is printed out as follows:
@@ -258,13 +264,13 @@ Use the following command to clean up a test RSA key and its corresponding certi
258264
notation certificate cleanup-test "wabbit-networks.io"
259265
```
260266

261-
A prompt will be displayed, asking the user to confirm the cleanup.
267+
A prompt will be displayed, asking the user to confirm the cleanup.
262268

263269
```text
264-
The test key <name> and its corresponding certificate will be cleaned up with the following changes:
265-
- Delete certificate <name>.crt from store <name> (type ca).
266-
- Remove key <name> from the key list.
267-
- Delete key file: {NOTATION_CONFIG}/localkeys/<name>.key.
270+
The test key <name> and its corresponding certificate will be cleaned up with the following changes:
271+
- Delete certificate <name>.crt from store <name> (type ca).
272+
- Remove key <name> from the key list.
273+
- Delete key file: {NOTATION_CONFIG}/localkeys/<name>.key.
268274
- Delete certificate file: {NOTATION_CONFIG}/localkeys/<name>.crt.
269275
270276
Are you sure you want to continue? [y/N]

0 commit comments

Comments
 (0)