github.com/mattyw/juju@v0.0.0-20140610034352-732aecd63861/cmd/juju/authorizedkeys.go (about)

     1  // Copyright 2012, 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package main
     5  
     6  import (
     7  	"launchpad.net/gnuflag"
     8  
     9  	"github.com/juju/juju/cmd"
    10  	"github.com/juju/juju/cmd/envcmd"
    11  )
    12  
    13  var authKeysDoc = `
    14  "juju authorized-keys" is used to manage the ssh keys allowed to log on to
    15  nodes in the Juju environment.
    16  
    17  `
    18  
    19  type AuthorizedKeysCommand struct {
    20  	*cmd.SuperCommand
    21  }
    22  
    23  func NewAuthorizedKeysCommand() cmd.Command {
    24  	sshkeyscmd := &AuthorizedKeysCommand{
    25  		SuperCommand: cmd.NewSuperCommand(cmd.SuperCommandParams{
    26  			Name:        "authorized-keys",
    27  			Doc:         authKeysDoc,
    28  			UsagePrefix: "juju",
    29  			Purpose:     "manage authorized ssh keys",
    30  			Aliases:     []string{"authorised-keys"},
    31  		}),
    32  	}
    33  	sshkeyscmd.Register(envcmd.Wrap(&AddKeysCommand{}))
    34  	sshkeyscmd.Register(envcmd.Wrap(&DeleteKeysCommand{}))
    35  	sshkeyscmd.Register(envcmd.Wrap(&ImportKeysCommand{}))
    36  	sshkeyscmd.Register(envcmd.Wrap(&ListKeysCommand{}))
    37  	return sshkeyscmd
    38  }
    39  
    40  func (c *AuthorizedKeysCommand) SetFlags(f *gnuflag.FlagSet) {
    41  	c.SetCommonFlags(f)
    42  }