R75: azure unauth copy-paste, dcr guard, cookie domain

This commit is contained in:
2026-08-13 17:44:34 +01:00
parent 5a54960cdd
commit e7378d640d
5 changed files with 95 additions and 8 deletions
+6 -6
View File
@@ -265,14 +265,14 @@ func TestAzureOIDCRegression(t *testing.T) {
rs := (&requestState{}).captureSession(session)
authenticated, needsRefresh, expired := tOidc.validateAzureTokensRS(rs)
// Should not be authenticated due to validation failure
// Should not be authenticated due to validation failure, and with no
// refresh token and no tokens to probe, should not claim an expiry
// state (matches the standard path: unauthenticated, no refresh).
if authenticated {
t.Error("Should not be authenticated when token validation fails")
}
// Should be marked as expired since no tokens work
if !expired && !needsRefresh {
t.Error("Should be marked as needing refresh or expired when validation fails")
if needsRefresh || expired {
t.Error("With no refresh token and no tokens to probe, should be (false,false,false)")
}
// Verify CSRF token is still preserved in session
@@ -691,7 +691,7 @@ func TestValidateAzureTokensEdgeCases(t *testing.T) {
return session
},
expectedAuth: false,
expectedRefresh: true,
expectedRefresh: false,
expectedExpired: false,
description: "Unauthenticated Azure session without refresh token",
},