- 修复RDP协议连接导致的任意文件读取漏洞
- RDP协议增加「域」参数 - 增加安全访问功能 - 优化代码
This commit is contained in:
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"github.com/labstack/echo/v4"
|
||||
"next-terminal/pkg/constant"
|
||||
"next-terminal/pkg/model"
|
||||
"next-terminal/pkg/utils"
|
||||
"strconv"
|
||||
@ -26,7 +27,7 @@ func CredentialCreateEndpoint(c echo.Context) error {
|
||||
item.Created = utils.NowJsonTime()
|
||||
|
||||
switch item.Type {
|
||||
case model.Custom:
|
||||
case constant.Custom:
|
||||
item.PrivateKey = "-"
|
||||
item.Passphrase = "-"
|
||||
if len(item.Username) == 0 {
|
||||
@ -35,7 +36,7 @@ func CredentialCreateEndpoint(c echo.Context) error {
|
||||
if len(item.Password) == 0 {
|
||||
item.Password = "-"
|
||||
}
|
||||
case model.PrivateKey:
|
||||
case constant.PrivateKey:
|
||||
item.Password = "-"
|
||||
if len(item.Username) == 0 {
|
||||
item.Username = "-"
|
||||
@ -90,7 +91,7 @@ func CredentialUpdateEndpoint(c echo.Context) error {
|
||||
}
|
||||
|
||||
switch item.Type {
|
||||
case model.Custom:
|
||||
case constant.Custom:
|
||||
item.PrivateKey = "-"
|
||||
item.Passphrase = "-"
|
||||
if len(item.Username) == 0 {
|
||||
@ -99,7 +100,7 @@ func CredentialUpdateEndpoint(c echo.Context) error {
|
||||
if len(item.Password) == 0 {
|
||||
item.Password = "-"
|
||||
}
|
||||
case model.PrivateKey:
|
||||
case constant.PrivateKey:
|
||||
item.Password = "-"
|
||||
if len(item.Username) == 0 {
|
||||
item.Username = "-"
|
||||
|
Reference in New Issue
Block a user