mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-04 20:49:06 +02:00
Replace RequireFlowInitiator with AuthzLevel and clear flow on switch profile
This commit is contained in:
@@ -18,6 +18,9 @@ type DaemonState interface {
|
||||
// whether one is held.
|
||||
SessionHolder() (Principal, bool)
|
||||
|
||||
// OwnsProfile reports whether id owns the profile a request names. An empty
|
||||
// handle is the active profile, which is what a method that acts on the
|
||||
// live session resolves against.
|
||||
OwnsProfile(id Identity, handle string) bool
|
||||
}
|
||||
|
||||
@@ -74,13 +77,6 @@ func RequireLevel(want AuthzLevel) Rule {
|
||||
}
|
||||
}
|
||||
|
||||
// RequireFlowInitiator binds a pending authentication flow to the identity that
|
||||
// started it.
|
||||
func RequireFlowInitiator(r Request) error {
|
||||
// TODO: needs the flow registry keyed by initiator.
|
||||
return nil
|
||||
}
|
||||
|
||||
func denyLevel(r Request, want AuthzLevel) error {
|
||||
return status.Errorf(codes.PermissionDenied,
|
||||
"%s requires %s, caller %s is %s", r.Method, want, r.Identity, r.Level)
|
||||
|
||||
Reference in New Issue
Block a user