Merge branch 'main' into embedded-vnc

This commit is contained in:
Viktor Liu
2026-09-03 14:35:48 +02:00
119 changed files with 11877 additions and 6890 deletions

View File

@@ -3,6 +3,7 @@ package sessionauth
import (
"errors"
"fmt"
"slices"
"sync"
log "github.com/sirupsen/logrus"
@@ -216,6 +217,24 @@ func (a *Authorizer) GetUserIDClaim() string {
return a.userIDClaim
}
// Config returns the authorization currently in force. The user list and the
// machine-user map are copies; the originals stay in use here.
func (a *Authorizer) Config() *Config {
a.mu.RLock()
defer a.mu.RUnlock()
machineUsers := make(map[string][]uint32, len(a.machineUsers))
for osUser, indexes := range a.machineUsers {
machineUsers[osUser] = slices.Clone(indexes)
}
return &Config{
UserIDClaim: a.userIDClaim,
AuthorizedUsers: slices.Clone(a.authorizedUsers),
MachineUsers: machineUsers,
}
}
// LookupSessionKey resolves a Noise-verified static public key to the
// hashed user identity registered with it. Fails closed when the key is
// unknown.