fix(test): add missing Type field in BenchmarkE2EBasicAuth

The AuthConfig struct requires Type="basic" for NewBasicAuth to
validate successfully. Without this field, the benchmark fails with
"unsupported auth type: ".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-04-30 08:01:43 +08:00
parent 0de9922e7d
commit 3c8413b7a6

View File

@ -1449,6 +1449,7 @@ func BenchmarkE2EBasicAuth(b *testing.B) {
// 创建 Basic Auth 中间件(使用 bcrypt 哈希)
bcryptPassword, _ := security.HashPassword("testpass", security.HashBcrypt)
auth, err := security.NewBasicAuth(&config.AuthConfig{
Type: "basic",
RequireTLS: false,
Users: []config.User{
{Name: "admin", Password: bcryptPassword},