fix(gateway): restore auth role refresh and Rust checks

Refresh the resolved user role without bypassing owner group and key policies. Resolve Rust 1.95 Clippy failures and make the pending persistence bound test scheduler-independent.
This commit is contained in:
elky
2026-07-22 11:25:24 +08:00
parent cd2fbeeead
commit 713010fa0a
8 changed files with 109 additions and 92 deletions
+8 -17
View File
@@ -175,25 +175,16 @@ impl Drop for AuthContextOwnedInflightGuard {
impl AuthContextCache {
fn finish_inflight(&self, cache_key: &str, state: &Arc<AuthContextInflightState>) {
let removed = self
.inflight
.lock()
.map(|mut inflight| {
if inflight
.get(cache_key)
.is_some_and(|current| Arc::ptr_eq(current, state))
{
state.complete();
inflight.remove(cache_key).is_some()
} else {
false
}
})
.unwrap_or(false);
if !removed {
if let Ok(mut inflight) = self.inflight.lock() {
// A clear may already have detached and completed this flight.
// Keep drop idempotent so an old guard cannot affect its replacement.
return;
if inflight
.get(cache_key)
.is_some_and(|current| Arc::ptr_eq(current, state))
{
state.complete();
inflight.remove(cache_key);
}
}
}