Replace RequireFlowInitiator with AuthzLevel and clear flow on switch profile

This commit is contained in:
Theodor S. Midtlien
2026-09-16 10:37:59 +02:00
parent 7705645492
commit 2d5ee900d0
4 changed files with 38 additions and 22 deletions
+7 -4
View File
@@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/netbirdio/netbird/client/internal"
"github.com/netbirdio/netbird/client/internal/auth"
"github.com/netbirdio/netbird/client/internal/peer"
"github.com/netbirdio/netbird/client/proto"
)
@@ -18,10 +19,12 @@ func newTestServer() *Server {
return &Server{
rootCtx: context.Background(),
statusRecorder: peer.NewRecorder(""),
// New always populates the SSH JWT cache and the logout and
// profile-switch paths call into it unconditionally, so a Server
// assembled field by field has to populate it too.
jwtCache: newJWTCache(),
// New always populates the SSH JWT cache and the pending extend-session
// flow, and the logout and profile-switch paths call into both
// unconditionally, so a Server assembled field by field has to populate
// them too.
jwtCache: newJWTCache(),
extendAuthSessionFlow: auth.NewPendingFlow(),
}
}