Organize device inventory by customer and restrict token access to its audience

This commit is contained in:
2026-11-17 21:55:24 +01:00
parent aeb9adc649
commit 0afaca1d64
39 changed files with 1950 additions and 225 deletions
+6
View File
@@ -210,6 +210,12 @@ impl LocalAuth {
workers: Arc::new(Semaphore::new(1)),
})
}
pub fn home(&self, principal: &str) -> Option<Uuid> {
self.users
.iter()
.find(|user| !user.disabled && user.principal == principal)
.map(|user| user.tenant)
}
pub fn enabled(&self, principal: &str, tenant: Uuid) -> bool {
self.users
.iter()