update to UserSSHKeypair per feedback

This commit is contained in:
techknowlogick
2025-08-08 12:20:39 -04:00
parent cee2ca0a7f
commit f97acdc60f
8 changed files with 65 additions and 60 deletions
+4 -4
View File
@@ -353,10 +353,10 @@ func loadKeysData(ctx *context.Context) {
// Create a struct with the public key including comment
publicKeyWithComment, _ := mirrorKeypair.GetPublicKeyWithComment(ctx)
mirrorKeyData := struct {
*repo_model.MirrorSSHKeypair
*repo_model.UserSSHKeypair
PublicKeyWithComment string
}{
MirrorSSHKeypair: mirrorKeypair,
UserSSHKeypair: mirrorKeypair,
PublicKeyWithComment: publicKeyWithComment,
}
@@ -366,8 +366,8 @@ func loadKeysData(ctx *context.Context) {
}
}
// RegenerateMirrorSSHKeyPair regenerates the SSH keypair for repository mirroring
func RegenerateMirrorSSHKeyPair(ctx *context.Context) {
// RegenerateUserSSHKeypair regenerates the SSH keypair for repository mirroring
func RegenerateUserSSHKeypair(ctx *context.Context) {
_, err := mirror_service.RegenerateSSHKeypairForUser(ctx, ctx.Doer.ID)
if err != nil {
ctx.ServerError("RegenerateSSHKeypairForUser", err)
+1 -1
View File
@@ -641,7 +641,7 @@ func registerWebRoutes(m *web.Router) {
m.Combo("/keys").Get(user_setting.Keys).
Post(web.Bind(forms.AddKeyForm{}), user_setting.KeysPost)
m.Post("/keys/delete", user_setting.DeleteKey)
m.Post("/keys/mirror-ssh/regenerate", user_setting.RegenerateMirrorSSHKeyPair)
m.Post("/keys/mirror-ssh/regenerate", user_setting.RegenerateUserSSHKeypair)
m.Group("/packages", func() {
m.Get("", user_setting.Packages)
m.Group("/rules", func() {