From 353dea047364dab2c4ee3b3c731df2d2e10a1c2b Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Thu, 30 Mar 2023 21:37:54 +0800 Subject: [PATCH 01/10] improve error output in notation key and notation cert Signed-off-by: Feynman Zhou --- specs/commandline/certificate.md | 12 +++++++++++- specs/commandline/key.md | 24 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/specs/commandline/certificate.md b/specs/commandline/certificate.md index aaa43d078..5f8146171 100644 --- a/specs/commandline/certificate.md +++ b/specs/commandline/certificate.md @@ -208,7 +208,17 @@ A prompt is showed asking user to confirm the deletion. Upon successful deletion notation certificate delete --type --store ``` -A prompt is showed asking user to confirm the deletion. Upon successful deletion, the specific certificate is deleted in trust store named `` of type ``. If deletion fails, an error message with specific reasons is printed out. +A prompt is showed asking user to confirm the deletion. Upon successful deletion, the specific certificate is deleted from the trust store named `` of type ``. The output message is printed out as following: + +```text +Successfully deleted from the trust store. +``` + +If users execute the deletion without specifying required flags using `notation cert delete `, the deletion fails and the error output message is printed out as follows: + +```text +Error: You need to specify the required flag "--type" and "--store". Try "notation cert delete -h" to view examples. +``` ### Generate a local RSA key and a corresponding self-generated certificate for testing purpose and add the certificate into trust store diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 020f190d3..42e6be960 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -16,7 +16,7 @@ Usage: Available Commands: add Add key to signing key list - delete Delete key from signing key list + remove Remove key from signing key list list List keys used for signing update Update key in signing key list @@ -45,10 +45,10 @@ Flags: ### notation key delete ```text -Delete key from signing key list +Remove key from signing key list Usage: - notation key delete [flags] ... + notation key remove [flags] ... Flags: -d, --debug debug mode @@ -115,10 +115,22 @@ notation key list Upon successful execution, a list of keys is printed out with information of name, key path, certificate path, key id and plugin name. The default signing key name is preceded by an asterisk. The key id and plugin name are used together to provide the information of the key identifier for the remote key and the plugin associated with it. -### Delete two keys from signing key list +### Remove a specified key from signing key list ```shell -notation key delete +notation key remove ``` -Upon successful execution, the names of deleted signing keys are printed out. Please be noted if default signing key is deleted, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. +Upon successful execution, the output message is printed out as following: + +```text +Removed from signing key list. You still need to delete the key file from and delete the certificate from . +``` + +### Remove two keys from signing key list + +```shell +notation key remove +``` + +Upon successful execution, the names of removed signing keys are printed out. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. From bbf418f95ff766119df9f8a64bac21076a0cfb6c Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Fri, 31 Mar 2023 16:13:43 +0800 Subject: [PATCH 02/10] update CLI spec for notation key and notation cert Signed-off-by: Feynman Zhou --- specs/commandline/certificate.md | 2 +- specs/commandline/key.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/specs/commandline/certificate.md b/specs/commandline/certificate.md index 5f8146171..7a5186421 100644 --- a/specs/commandline/certificate.md +++ b/specs/commandline/certificate.md @@ -217,7 +217,7 @@ Successfully deleted from the trust store. If users execute the deletion without specifying required flags using `notation cert delete `, the deletion fails and the error output message is printed out as follows: ```text -Error: You need to specify the required flag "--type" and "--store". Try "notation cert delete -h" to view examples. +Error: required flag(s) "store", "type" not set ``` ### Generate a local RSA key and a corresponding self-generated certificate for testing purpose and add the certificate into trust store diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 42e6be960..a4f508e57 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -121,11 +121,16 @@ Upon successful execution, a list of keys is printed out with information of nam notation key remove ``` -Upon successful execution, the output message is printed out as following: +- Upon successful execution, the output message is printed out as below when removed a key created by notation for local testing purpose: ```text Removed from signing key list. You still need to delete the key file from and delete the certificate from . ``` +- Upon successful execution, the output message is printed out as below when removed a key associates with a KMS: + +```text +Removed from signing key list. +``` ### Remove two keys from signing key list From 987db4cc3610678d03f111d16fbe1e7e9d3fe227 Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Tue, 11 Apr 2023 16:13:58 +0800 Subject: [PATCH 03/10] update notation CLI spec for notation key Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index a4f508e57..bc05be354 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -121,12 +121,12 @@ Upon successful execution, a list of keys is printed out with information of nam notation key remove ``` -- Upon successful execution, the output message is printed out as below when removed a key created by notation for local testing purpose: +- Upon successful removal of a local testing key created by notation, the output message is printed out as follows: ```text -Removed from signing key list. You still need to delete the key file from and delete the certificate from . +Removed from signing key list. The source key file is still existed in . ``` -- Upon successful execution, the output message is printed out as below when removed a key associates with a KMS: +- Upon successful removal of a key associated with a KMS, the output message is printed out as follows: ```text Removed from signing key list. @@ -138,4 +138,10 @@ Removed from signing key list. notation key remove ``` -Upon successful execution, the names of removed signing keys are printed out. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. +Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. + +```text +Removed the following keys from signing key list. The source key files are still existed in . + + +``` \ No newline at end of file From f9d8224515f8ee25c3e419e6ae9ab58e1c7d7157 Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Tue, 11 Apr 2023 16:24:41 +0800 Subject: [PATCH 04/10] update notation CLI spec for notation key Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index bc05be354..3545a764f 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -2,7 +2,7 @@ ## Description -Use ```notation key``` command to manage keys used for signing. User can add/update/list/remove key to/from signing key list. Please be noted this command doesn't manage the lifecycle of signing key itself, it manages the signing key list only. +Use ```notation key``` command to manage keys used for signing. User can add/update/list/remove key to/from Notation signing key list. Please be noted this command doesn't manage the lifecycle of signing key itself, it manages the Notation signing key list only. ## Outline @@ -15,10 +15,10 @@ Usage: notation key [command] Available Commands: - add Add key to signing key list - remove Remove key from signing key list + add Add key to Notation signing key list + remove Remove key from Notation signing key list list List keys used for signing - update Update key in signing key list + update Update key in Notation signing key list Flags: -h, --help help for key @@ -27,7 +27,7 @@ Flags: ### notation key add ```text -Add key to signing key list +Add key to Notation signing key list Usage: notation key add --plugin [flags] @@ -45,7 +45,7 @@ Flags: ### notation key delete ```text -Remove key from signing key list +Remove key from Notation signing key list Usage: notation key remove [flags] ... @@ -74,7 +74,7 @@ Flags: ### notation key update ```text -Update key in signing key list +Update key in Notation signing key list Usage: notation key update [flags] @@ -115,7 +115,7 @@ notation key list Upon successful execution, a list of keys is printed out with information of name, key path, certificate path, key id and plugin name. The default signing key name is preceded by an asterisk. The key id and plugin name are used together to provide the information of the key identifier for the remote key and the plugin associated with it. -### Remove a specified key from signing key list +### Remove a specified key from Notation signing key list ```shell notation key remove @@ -124,15 +124,15 @@ notation key remove - Upon successful removal of a local testing key created by notation, the output message is printed out as follows: ```text -Removed from signing key list. The source key file is still existed in . +Removed from Notation signing key list. The source key file is still existed in . ``` - Upon successful removal of a key associated with a KMS, the output message is printed out as follows: ```text -Removed from signing key list. +Removed from Notation signing key list. ``` -### Remove two keys from signing key list +### Remove two keys from Notation signing key list ```shell notation key remove @@ -141,7 +141,7 @@ notation key remove Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. ```text -Removed the following keys from signing key list. The source key files are still existed in . +Removed the following keys from Notation signing key list. The source key files are still existed in . ``` \ No newline at end of file From bc8e515608712e32f0969b90ea1f473cc3b50d78 Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Thu, 13 Apr 2023 15:57:40 +0800 Subject: [PATCH 05/10] update CLI spec for notation key Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 3545a764f..5431f9b4f 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -124,7 +124,7 @@ notation key remove - Upon successful removal of a local testing key created by notation, the output message is printed out as follows: ```text -Removed from Notation signing key list. The source key file is still existed in . +Removed from Notation signing key list. The source key file still exists locally. ``` - Upon successful removal of a key associated with a KMS, the output message is printed out as follows: @@ -141,7 +141,7 @@ notation key remove Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. ```text -Removed the following keys from Notation signing key list. The source key files are still existed in . +Removed the following keys from Notation signing key list. The source key files still exist locally. ``` \ No newline at end of file From 49195514a8a3bcf950a6191fb73321e636fd4d69 Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Fri, 14 Apr 2023 11:04:06 +0800 Subject: [PATCH 06/10] update notation key CLI spec Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 5431f9b4f..873f3ec54 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -124,12 +124,12 @@ notation key remove - Upon successful removal of a local testing key created by notation, the output message is printed out as follows: ```text -Removed from Notation signing key list. The source key file still exists locally. +Removed from Notation signing key list. The source key file still exists. ``` - Upon successful removal of a key associated with a KMS, the output message is printed out as follows: ```text -Removed from Notation signing key list. +Removed from Notation signing key list. The source key files still exist. ``` ### Remove two keys from Notation signing key list @@ -141,7 +141,7 @@ notation key remove Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. ```text -Removed the following keys from Notation signing key list. The source key files still exist locally. +Removed the following keys from Notation signing key list. The source key files still exist. ``` \ No newline at end of file From fd772adaee4b956a0f94fd92b96687c7d7efc2ee Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Fri, 14 Apr 2023 15:03:23 +0800 Subject: [PATCH 07/10] update CLI spec Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 873f3ec54..8d2e273ee 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -48,7 +48,7 @@ Flags: Remove key from Notation signing key list Usage: - notation key remove [flags] ... + notation key delete [flags] ... Flags: -d, --debug debug mode @@ -118,7 +118,7 @@ Upon successful execution, a list of keys is printed out with information of nam ### Remove a specified key from Notation signing key list ```shell -notation key remove +notation key delete ``` - Upon successful removal of a local testing key created by notation, the output message is printed out as follows: @@ -135,7 +135,7 @@ Removed from Notation signing key list. The source key files still ex ### Remove two keys from Notation signing key list ```shell -notation key remove +notation key delete ``` Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. From 8faf0452a93515fc2f3035f920cf9e4307841ead Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Fri, 14 Apr 2023 15:05:01 +0800 Subject: [PATCH 08/10] update CLI spec Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index 8d2e273ee..a67ae44b4 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -16,7 +16,7 @@ Usage: Available Commands: add Add key to Notation signing key list - remove Remove key from Notation signing key list + delete Remove key from Notation signing key list list List keys used for signing update Update key in Notation signing key list From 725da57368e2bb96a7524fce45cf54d252730996 Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Fri, 21 Apr 2023 10:37:23 +0800 Subject: [PATCH 09/10] update notation key spec Signed-off-by: Feynman Zhou --- specs/commandline/key.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/commandline/key.md b/specs/commandline/key.md index a67ae44b4..bc5b64a64 100644 --- a/specs/commandline/key.md +++ b/specs/commandline/key.md @@ -124,12 +124,12 @@ notation key delete - Upon successful removal of a local testing key created by notation, the output message is printed out as follows: ```text -Removed from Notation signing key list. The source key file still exists. +Removed from Notation signing key list. The source key still exists. ``` - Upon successful removal of a key associated with a KMS, the output message is printed out as follows: ```text -Removed from Notation signing key list. The source key files still exist. +Removed from Notation signing key list. The source key still exists. ``` ### Remove two keys from Notation signing key list @@ -141,7 +141,7 @@ notation key delete Upon successful execution, the output message is printed out as follows. Please be noted if default signing key is removed, Notation will not automatically assign a new default signing key. User needs to update the default signing key explicitly. ```text -Removed the following keys from Notation signing key list. The source key files still exist. +Removed the following keys from Notation signing key list. The source keys still exist. ``` \ No newline at end of file From b83088b5bdf4ff54bc8a35192b8bf9007cc2badc Mon Sep 17 00:00:00 2001 From: Feynman Zhou Date: Thu, 27 Apr 2023 20:02:35 +0800 Subject: [PATCH 10/10] doc: update the CLI spec for notation cert Signed-off-by: Feynman Zhou --- specs/commandline/certificate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/commandline/certificate.md b/specs/commandline/certificate.md index 7a5186421..bbb052625 100644 --- a/specs/commandline/certificate.md +++ b/specs/commandline/certificate.md @@ -208,7 +208,7 @@ A prompt is showed asking user to confirm the deletion. Upon successful deletion notation certificate delete --type --store ``` -A prompt is showed asking user to confirm the deletion. Upon successful deletion, the specific certificate is deleted from the trust store named `` of type ``. The output message is printed out as following: +A prompt is displayed, asking the user to confirm the deletion. Upon successful deletion, the specific certificate is deleted from the trust store named `` of type ``. The output message is printed out as following: ```text Successfully deleted from the trust store.