test: покрыть NopAuthenticator, GenerateSelfSignedCert, HandshakeSem

Минимальное покрытие для заготовки auth и хелперов dtlsdial:
- NopAuthenticator.Authenticate возвращает (Anonymous, nil)
- GenerateSelfSignedCert выдаёт рабочий сертификат с приватным ключом
- HandshakeSem блокирует захват при заполнении и уважает отмену ctx

Также документирует на Authenticator, что интерфейс stream-ориентирован; auth
UDP-режима получит отдельный token-based интерфейс.
This commit is contained in:
samosvalishe committed 2026-05-21 02:02:23 +03:00
1 parent c4b6774241
commit 3b73d720f1
4 files changed
+73

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
package auth
import "testing"
func TestNopAuthenticatorReturnsAnonymous(t *testing.T) {
tenant, err := NopAuthenticator{}.Authenticate(t.Context(), nil)
if err != nil {
t.Fatalf("NopAuthenticator.Authenticate: %v", err)
}
if tenant != Anonymous {
t.Fatalf("tenant = %q want Anonymous (%q)", tenant, Anonymous)
}
}