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
+3 -7
View File
@@ -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)