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
6 changed files with 334 additions and 48 deletions

View file

@ -73,6 +73,9 @@ timeout`**, with a test asserting the relation — a responder that answers
It is one request's whole budget: when the `IdP` refuses the responder's own
secret, the re-read from the store and the one retry fit inside it, or the
request is denied and the re-read lands for the next one.
- **The responder answers requests concurrently, up to a fixed cap**, so one
slow lookup doesn't hold the requests behind it. A request whose `exp` has
passed gets no lookup and no reply: the server has stopped waiting for it.
- **Every issued user JWT expires**, at the presented OIDC token's own `exp`
or an hour after issue, whichever is sooner. nats-server closes the
connection at that point, and the client's reconnect comes back through