2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

server/key: Rename CreateKey -> CreateMasterKey

This commit is contained in:
Alexander Neumann 2015-05-03 17:17:10 +02:00
parent 9b54fd7bdb
commit bebb08ee7e
4 changed files with 9 additions and 7 deletions

View File

@ -75,7 +75,7 @@ func (cmd CmdInit) Execute(args []string) error {
s := server.NewServer(be) s := server.NewServer(be)
_, err = server.CreateKey(s, pw) _, err = server.CreateMasterKey(s, pw)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "creating key in backend at %s failed: %v\n", opts.Repo, err) fmt.Fprintf(os.Stderr, "creating key in backend at %s failed: %v\n", opts.Repo, err)
os.Exit(1) os.Exit(1)

View File

@ -50,9 +50,9 @@ type Key struct {
name string name string
} }
// CreateKey initializes a master key in the given backend and encrypts it with // CreateMasterKey creates a new master key in the given backend and encrypts
// the password. // it with the password.
func CreateKey(s *Server, password string) (*Key, error) { func CreateMasterKey(s *Server, password string) (*Key, error) {
return AddKey(s, password, nil) return AddKey(s, password, nil)
} }

View File

@ -531,8 +531,10 @@ func (s *Server) SearchKey(password string) error {
return nil return nil
} }
func (s *Server) CreateKey(password string) error { // CreateMasterKey creates a new key with the supplied password, afterwards the
key, err := CreateKey(s, password) // repository config is created.
func (s *Server) CreateMasterKey(password string) error {
key, err := CreateMasterKey(s, password)
if err != nil { if err != nil {
return err return err
} }

View File

@ -30,7 +30,7 @@ func SetupBackend(t testing.TB) *server.Server {
OK(t, err) OK(t, err)
s := server.NewServer(b) s := server.NewServer(b)
OK(t, s.CreateKey(*TestPassword)) OK(t, s.CreateMasterKey(*TestPassword))
return s return s
} }