Watch
0
0
Fork
You've already forked hyperhive
0

swarm-nats-auth: answer callout requests concurrently, skip expired ones

Each request now runs in its own task, at most CONCURRENT_REQUESTS (32)
at once, instead of being awaited inline by the subscription loop. A
request whose exp (nats-server sets it to send time plus its
authorization.timeout) has passed is skipped without a lookup or reply.

Fixes #5434.
This commit is contained in:
atlas 2026-10-17 15:56:06 +02:00 • committed by mara
commit 6971b4e4ed

View file

@ -240,7 +240,7 @@ pub(crate) mod tests {
let (server_key, opened) = open(&own, Some(&server.public_key()), &sealed).expect("opens");
assert_eq!(server_key.public_key(), server.public_key());
let req = crate::request::decode(&opened).expect("a request");
assert_eq!(req.user_nkey, "UCLIENT");
assert_eq!(req.nats.user_nkey, "UCLIENT");
let issuer = nkeys::KeyPair::new_account();
let permissions = crate::policy::Permissions {
@ -251,8 +251,8 @@ pub(crate) mod tests {
let token = crate::respond::grant(
&issuer,
"APP",
&req.server_id.id,
&req.user_nkey,
&req.nats.server_id.id,
&req.nats.user_nkey,
&permissions,
None,
);