Files
Pulse/internal/api/websocket_auth.go
pulse-triage[bot] 35780acb0a End confidential reads with their admitted browser session
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
2026-11-01 08:33:40 +00:00

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
}
}