mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 10:27:46 +08:00
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:
+8
-17
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user