mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
test(web): add percentage checking of characters displaying in APIKey
This commit is contained in:
@@ -311,7 +311,7 @@ func (h *Handler) handleSetDefaultModel(w http.ResponseWriter, r *http.Request)
|
||||
// Keys 9-12 chars show prefix + last 2 chars: "sk-****cd".
|
||||
// Shorter keys are fully masked as "****".
|
||||
// Empty keys return empty string.
|
||||
// Ensure at least 40% of the key is masked.
|
||||
// Ensure at least 40% of the key will not be displayed.
|
||||
func maskAPIKey(key string) string {
|
||||
if key == "" {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user