feat(lib): add (*TraefikOidc).Ready() metadata-discovery readiness accessor

This commit is contained in:
2026-05-19 13:19:20 +01:00
parent 46777d0510
commit ded90e5dc1
2 changed files with 31 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package traefikoidc
import "testing"
func TestReady_FalseBeforeMetadata(t *testing.T) {
tr := &TraefikOidc{}
if tr.Ready() {
t.Fatal("Ready() should be false before metadata discovery")
}
}
func TestReady_TrueAfterAuthURLSet(t *testing.T) {
tr := &TraefikOidc{}
tr.metadataMu.Lock()
tr.authURL = "https://idp.example/authorize"
tr.metadataMu.Unlock()
if !tr.Ready() {
t.Fatal("Ready() should be true once authURL is populated")
}
}