MCPcopy Create free account
hub / github.com/koding/kite / initialKey

Function initialKey

kontrol/kontrol/main.go:107–130  ·  view source on GitHub ↗
(kontrolConf *Kontrol, publicKey, privateKey []byte)

Source from the content-addressed store, hash-verified

105}
106
107func initialKey(kontrolConf *Kontrol, publicKey, privateKey []byte) {
108 conf := config.New()
109
110 if kontrolConf.Username == "" {
111 log.Fatalln("empty username")
112 }
113 conf.Username = kontrolConf.Username
114
115 _, err := url.Parse(kontrolConf.KontrolURL)
116 if err != nil {
117 log.Fatalln("cannot parse kontrol URL")
118 }
119
120 conf.KontrolURL = kontrolConf.KontrolURL
121
122 k := kontrol.New(conf, kontrolConf.Version)
123 k.AddKeyPair("", string(publicKey), string(privateKey))
124 err = k.InitializeSelf()
125 if err != nil {
126 log.Fatal(err)
127 }
128
129 fmt.Println("kite.key is written to ~/.kite/kite.key. You can see it with:\n\tkitectl showkey")
130}

Callers 1

mainFunction · 0.85

Calls 3

AddKeyPairMethod · 0.80
InitializeSelfMethod · 0.80
FatalMethod · 0.80

Tested by

no test coverage detected