完善 API Key 能力范围可视化和维护

This commit is contained in:
2026-06-07 19:01:32 +08:00
parent dc14866210
commit f47132a653
19 changed files with 1165 additions and 49 deletions
@@ -0,0 +1,14 @@
package store
import (
"reflect"
"testing"
)
func TestNormalizeAPIKeyScopes(t *testing.T) {
got := normalizeAPIKeyScopes([]string{" Chat ", "AUDIO", "", "chat", "*", "all", " text_to_speech "})
want := []string{"chat", "audio", "all", "text_to_speech"}
if !reflect.DeepEqual(got, want) {
t.Fatalf("normalize scopes = %#v, want %#v", got, want)
}
}