mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat: encrypt login and install request #852
This commit is contained in:
parent
8e523258b5
commit
20531971cf
16 changed files with 265 additions and 108 deletions
22
api/crypto/crypto.go
Normal file
22
api/crypto/crypto.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package crypto
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/sign"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// GetPublicKey generates a new ED25519 key pair and registers it in the cache
|
||||
func GetPublicKey(c *gin.Context) {
|
||||
sign, err := sign.GetCryptoParams()
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"public_key": sign.PublicKey,
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue