mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
Retain actual successful session admission rather than ambient cookies. Recheck exact store, creation identity, principal, recovery binding and expiry at the existing protected stream and JSON writers, without extending expiry or falling back to another credential. Preserve independent job lifetimes, token and proxy policy. Cover persisted logout, independent readers, secure cookies and native consumer wire evidence in registered tests and contracts. Change-source: pulse-maintainer
21 lines
540 B
Go
21 lines
540 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/config"
|
|
)
|
|
|
|
func monitoringWebSocketAuthorization(cfg *config.Config, req *http.Request) func() bool {
|
|
// The socket writer outlives this HTTP request. Give it an immutable
|
|
// request copy, not one its returning middleware may still be observing.
|
|
revalidate := monitoringTokenSnapshotRevalidator(cfg, req.Clone(req.Context()))
|
|
if revalidate == nil {
|
|
return sessionReadRevalidator(req)
|
|
}
|
|
return func() bool {
|
|
_, ok := revalidate()
|
|
return ok
|
|
}
|
|
}
|