security: Đóng gói và bảo vệ khóa giải mã nội bộ trong binary, gỡ bỏ hoàn toàn khỏi cấu hình và tài liệu
This commit is contained in:
+1
-12
@@ -30,9 +30,6 @@ func HandleGetAdminConfig(w http.ResponseWriter, r *http.Request) {
|
||||
if respCfg.Updater.Token != "" {
|
||||
respCfg.Updater.Token = "••••••••"
|
||||
}
|
||||
if respCfg.License.CryptoKey != "" {
|
||||
respCfg.License.CryptoKey = "••••••••"
|
||||
}
|
||||
|
||||
_ = json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
"success": true,
|
||||
@@ -83,15 +80,7 @@ func HandleSaveAdminConfig(w http.ResponseWriter, r *http.Request) {
|
||||
input.Updater.Token = enc
|
||||
}
|
||||
|
||||
// Handle License Crypto Key
|
||||
if input.License.CryptoKey == "" || input.License.CryptoKey == "••••••••" {
|
||||
input.License.CryptoKey = current.License.CryptoKey
|
||||
input.DecryptedCryptoKey = current.DecryptedCryptoKey
|
||||
} else {
|
||||
input.DecryptedCryptoKey = input.License.CryptoKey
|
||||
enc, _ := config.Encrypt(input.License.CryptoKey)
|
||||
input.License.CryptoKey = enc
|
||||
}
|
||||
// Handle License Key
|
||||
if input.License.Key == "" {
|
||||
input.License.Key = current.License.Key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user