(repo *git.Repository)
| 24 | } |
| 25 | |
| 26 | func (c *Config) ensureAdminEd25519Key(repo *git.Repository) error { |
| 27 | return repo.UpdateFile("ssh/id_ed25519", func(data []byte) ([]byte, error) { |
| 28 | if data != nil { |
| 29 | return data, nil |
| 30 | } |
| 31 | |
| 32 | pk, err := models.GenerateEd25519PrivateKey() |
| 33 | if err != nil { |
| 34 | return nil, err |
| 35 | } |
| 36 | |
| 37 | return pk.MarshalPrivateKey() |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | func (c *Config) ensureAdminRSAKey(repo *git.Repository) error { |
| 42 | return repo.UpdateFile("ssh/id_rsa", func(data []byte) ([]byte, error) { |
no test coverage detected