Descriptions now use Trusted Collection everywhere

This commit is contained in:
Diogo Monica 2015-06-18 21:44:54 -07:00
parent 8da91369b8
commit 7b86665cf8
3 changed files with 28 additions and 28 deletions

View File

@ -36,7 +36,7 @@ func init() {
var cmdKeysRemove = &cobra.Command{ var cmdKeysRemove = &cobra.Command{
Use: "remove [ Subject Key ID ]", Use: "remove [ Subject Key ID ]",
Short: "removes trust from a specific certificate authority or certificate.", Short: "Removes trust from a specific certificate authority or certificate.",
Long: "remove trust from a specific certificate authority.", Long: "remove trust from a specific certificate authority.",
Run: keysRemove, Run: keysRemove,
} }
@ -44,14 +44,14 @@ var cmdKeysRemove = &cobra.Command{
var cmdKeysTrust = &cobra.Command{ var cmdKeysTrust = &cobra.Command{
Use: "trust [ certificate ]", Use: "trust [ certificate ]",
Short: "Trusts a new certificate.", Short: "Trusts a new certificate.",
Long: "Adds a the certificate to the trusted certificate authority list.", Long: "adds a the certificate to the trusted certificate authority list.",
Run: keysTrust, Run: keysTrust,
} }
var cmdKeysGenerate = &cobra.Command{ var cmdKeysGenerate = &cobra.Command{
Use: "generate [ GUN ]", Use: "generate [ GUN ]",
Short: "Generates a new key for a specific GUN.", Short: "Generates a new key for a specific GUN.",
Long: "generates a new key for a specific GUN. Global Unique Name.", Long: "generates a new key for a specific Global Unique Name.",
Run: keysGenerate, Run: keysGenerate,
} }
@ -69,7 +69,7 @@ func keysRemove(cmd *cobra.Command, args []string) {
err = caStore.RemoveCert(cert) err = caStore.RemoveCert(cert)
if err != nil { if err != nil {
fatalf("failed to remove certificate for Root KeyStore") fatalf("failed to remove certificate from KeyStore")
} }
failed = false failed = false
} }
@ -95,7 +95,7 @@ func keysTrust(cmd *cobra.Command, args []string) {
if err == nil && url.Scheme != "" { if err == nil && url.Scheme != "" {
cert, err = trustmanager.GetCertFromURL(certLocationStr) cert, err = trustmanager.GetCertFromURL(certLocationStr)
if err != nil { if err != nil {
fatalf("error retreiving certificate from url (%s): %v", certLocationStr, err) fatalf("error retrieving certificate from url (%s): %v", certLocationStr, err)
} }
} else if _, err := os.Stat(certLocationStr); err == nil { } else if _, err := os.Stat(certLocationStr); err == nil {
// Try to load the certificate from the file // Try to load the certificate from the file

View File

@ -88,8 +88,8 @@ func init() {
func main() { func main() {
var NotaryCmd = &cobra.Command{ var NotaryCmd = &cobra.Command{
Use: "notary", Use: "notary",
Short: "notary creates trust for docker", Short: "notary allows the creation of trusted collections.",
Long: "notary is the main trust-related command for Docker.", Long: "notary allows the creation and management of collections of signed targets, allowing the signing and validation of arbitrary content.",
} }
NotaryCmd.AddCommand(cmdKeys) NotaryCmd.AddCommand(cmdKeys)

View File

@ -25,57 +25,57 @@ var remoteTrustServer string
var cmdTufList = &cobra.Command{ var cmdTufList = &cobra.Command{
Use: "list [ GUN ]", Use: "list [ GUN ]",
Short: "Lists targets for a GUN", Short: "Lists targets for a trusted collection.",
Long: "Lists all targets for a Globally Unique Name.", Long: "Lists all targets for a trusted collection identified by the Globally Unique Name.",
Run: tufList, Run: tufList,
} }
var cmdTufAdd = &cobra.Command{ var cmdTufAdd = &cobra.Command{
Use: "add [ GUN ] <target> <file>", Use: "add [ GUN ] <target> <file>",
Short: "adds the file as a target to the GUN.", Short: "adds the file as a target to the trusted collection.",
Long: "adds the file as a target to the local trusted collection Global Unique Name.", Long: "adds the file as a target to the local trusted collection identified by the Globally Unique Name.",
Run: tufAdd, Run: tufAdd,
} }
var cmdTufRemove = &cobra.Command{ var cmdTufRemove = &cobra.Command{
Use: "remove [ GUN ] <target>", Use: "remove [ GUN ] <target>",
Short: "Removes a target from the TUF repo.", Short: "Removes a target from a trusted collection.",
Long: "removes a target from the local TUF repo identified by a Globally Unique Name.", Long: "removes a target from the local trusted collection identified by the Globally Unique Name.",
Run: tufRemove, Run: tufRemove,
} }
var cmdTufInit = &cobra.Command{ var cmdTufInit = &cobra.Command{
Use: "init [ GUN ]", Use: "init [ GUN ]",
Short: "initializes the local TUF repository.", Short: "initializes a local trusted collection.",
Long: "creates locally the initial set of TUF metadata for the Globally Unique Name.", Long: "initializes a local trusted collection identified by the Globally Unique Name.",
Run: tufInit, Run: tufInit,
} }
var cmdTufLookup = &cobra.Command{ var cmdTufLookup = &cobra.Command{
Use: "lookup [ GUN ] <target name>", Use: "lookup [ GUN ] <target>",
Short: "Looks up a specific TUF target in a repository.", Short: "Looks up a specific target in a trusted collection.",
Long: "looks up a TUF target in a repository given a Globally Unique Name.", Long: "looks up a specific target in a trusted collection identified by the Globally Unique Name.",
Run: tufLookup, Run: tufLookup,
} }
var cmdTufPublish = &cobra.Command{ var cmdTufPublish = &cobra.Command{
Use: "publish [ GUN ]", Use: "publish [ GUN ]",
Short: "initializes the local TUF repository.", Short: "publishes the local trusted collection.",
Long: "publishes the local changes to the remote trust server.", Long: "publishes the local trusted collection identified by the Globally Unique Name, sending the local changes to a remote trusted server.",
Run: tufPublish, Run: tufPublish,
} }
var cmdVerify = &cobra.Command{ var cmdVerify = &cobra.Command{
Use: "verify [ GUN ] <target>", Use: "verify [ GUN ] <target>",
Short: "checks if the content is included in the trusted collection for the GUN", Short: "verifies if the content is included in the trusted collection",
Long: "reads from STDIN and checks if the content is included in the trusted collection for the Global Unique Name.", Long: "verifies if the data passed in STDIN is included in the trusted collection identified by the Global Unique Name.",
Run: verify, Run: verify,
} }
func tufAdd(cmd *cobra.Command, args []string) { func tufAdd(cmd *cobra.Command, args []string) {
if len(args) < 3 { if len(args) < 3 {
cmd.Usage() cmd.Usage()
fatalf("must specify a GUN, target name, and local path to target data") fatalf("must specify a GUN, target, and path to target data")
} }
gun := args[0] gun := args[0]
@ -195,7 +195,7 @@ func tufList(cmd *cobra.Command, args []string) {
func tufLookup(cmd *cobra.Command, args []string) { func tufLookup(cmd *cobra.Command, args []string) {
if len(args) < 2 { if len(args) < 2 {
cmd.Usage() cmd.Usage()
fatalf("must specify a GUN and target name") fatalf("must specify a GUN and target")
} }
gun := args[0] gun := args[0]
targetName := args[1] targetName := args[1]
@ -292,7 +292,7 @@ func tufPublish(cmd *cobra.Command, args []string) {
func tufRemove(cmd *cobra.Command, args []string) { func tufRemove(cmd *cobra.Command, args []string) {
if len(args) < 2 { if len(args) < 2 {
cmd.Usage() cmd.Usage()
fatalf("must specify a GUN and target name") fatalf("must specify a GUN and target")
} }
gun := args[0] gun := args[0]
targetName := args[1] targetName := args[1]
@ -315,7 +315,7 @@ func tufRemove(cmd *cobra.Command, args []string) {
func verify(cmd *cobra.Command, args []string) { func verify(cmd *cobra.Command, args []string) {
if len(args) < 2 { if len(args) < 2 {
cmd.Usage() cmd.Usage()
fatalf("must specify a GUN and target name") fatalf("must specify a GUN and target")
} }
// Reads all of the data on STDIN // Reads all of the data on STDIN
@ -374,7 +374,7 @@ func verify(cmd *cobra.Command, args []string) {
stdinHash := fmt.Sprintf("sha256:%x", sha256.Sum256(payload)) stdinHash := fmt.Sprintf("sha256:%x", sha256.Sum256(payload))
serverHash := fmt.Sprintf("sha256:%s", meta.Hashes["sha256"]) serverHash := fmt.Sprintf("sha256:%s", meta.Hashes["sha256"])
if stdinHash != serverHash { if stdinHash != serverHash {
_, _ = os.Stderr.Write([]byte("Data not present in the trusted collection\n")) _, _ = os.Stderr.Write([]byte("Data not present in the trusted collection.\n"))
} else { } else {
_, _ = os.Stdout.Write(payload) _, _ = os.Stdout.Write(payload)
} }
@ -450,7 +450,7 @@ func bootstrapRepo(gun string, repo *tuf.TufRepo) store.MetadataStore {
fatalf(err.Error()) fatalf(err.Error())
} }
fmt.Println("Loading TUF Repository.") fmt.Println("Loading trusted collection.")
rootJSON, err := filestore.GetMeta("root", 0) rootJSON, err := filestore.GetMeta("root", 0)
if err != nil { if err != nil {
fatalf(err.Error()) fatalf(err.Error())