feat: 优化代理服务
This commit is contained in:
12
internal/utils/string_utils.go
Normal file
12
internal/utils/string_utils.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "fmt"
|
||||
|
||||
// MaskAPIKey masks an API key for safe logging.
|
||||
func MaskAPIKey(key string) string {
|
||||
length := len(key)
|
||||
if length <= 8 {
|
||||
return key
|
||||
}
|
||||
return fmt.Sprintf("%s****%s", key[:4], key[length-4:])
|
||||
}
|
Reference in New Issue
Block a user