node token: embed permissions directly in JWT

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-08-22 15:50:20 +02:00
parent 6bde42fc3f
commit a5dd529d88
4 changed files with 54 additions and 20 deletions

View File

@@ -264,7 +264,9 @@ func disconnectUser(username, admin, role string) {
logger.Warn(logSender, "", "unable to disconnect user %q, error getting node %q: %v", username, stat.Node, err)
continue
}
if err := n.SendDeleteRequest(admin, role, fmt.Sprintf("%s/%s", activeConnectionsPath, stat.ConnectionID)); err != nil {
perms := []string{dataprovider.PermAdminCloseConnections}
uri := fmt.Sprintf("%s/%s", activeConnectionsPath, stat.ConnectionID)
if err := n.SendDeleteRequest(admin, role, uri, perms); err != nil {
logger.Warn(logSender, "", "unable to disconnect user %q from node %q, error: %v", username, n.Name, err)
}
}