ci / vet-and-test (pull_request) Successful in 49s
Why: Legacy project streams replayed upload filenames and parser metadata to newly authorized members even though the underlying cards remained owner-only. Evidence: SELF real HTTP red regressions exposed legacy replay, spoofed sharing claims, private-history pagination, and live delivery after membership removal. The affected packages, uncached full Backend suite, isolated PostgreSQL Store suite, and agent-system build pass after applying the event boundary. Impact: Registered lifecycle streams resolve trusted resource ownership and require an internal publication proof for cross-owner delivery. Event and proof commit in one transaction; v30 adds an additive SQLite/PostgreSQL sidecar without granting access to historical events. Seen and visible cursors remain separate, revoked members leave live streams, and unregistered base behavior remains compatible. The storage migration tool preserves the new proof rows. Refs: project-member-access-implementation-plan.md Task 1 / R5; authorized legacy SSE privacy follow-up; project-member-composed-legacy-project-history.json
31 lines
880 B
Go
31 lines
880 B
Go
package server
|
|
|
|
import (
|
|
core "agent-system-core"
|
|
)
|
|
|
|
// projectStreamMembership consults the registered resource authorizer using the
|
|
// physical project's trusted owner, never the event publisher or payload claims.
|
|
func (s *Server) projectStreamMembership(actor, project string) bool {
|
|
p, err := s.st.ProjectMetadata(project)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
return s.authorizeSharedResource(actor, "stream", "project", project, p.Owner, project)
|
|
}
|
|
|
|
func (s *Server) projectEventVisible(actor string, event core.StreamEvent) bool {
|
|
if s.projectLifecycle == nil {
|
|
return true
|
|
}
|
|
access, err := s.st.ResolveProjectEventAccess(event)
|
|
if err != nil || access.Owner == "" {
|
|
return false
|
|
}
|
|
if access.Owner == actor {
|
|
return true
|
|
}
|
|
project, ok := core.ProjectFromChannel(event.ConversationID)
|
|
return ok && access.Shared && s.projectStreamMembership(actor, project)
|
|
}
|