security: access control for particles (#169)

* setup firebase custom token

* docs

* docs

* feat: allow admin removing members from a network

* fix: properly handle fallback avatar and names

This is especially helpful in the case of members who were removed from
a network
This commit was merged in pull request #169.
This commit is contained in:
Arjun Patel
2026-04-16 15:14:34 -07:00
committed by GitHub
parent 28b1ff542b
commit ef899ee5cd
36 changed files with 805 additions and 169 deletions
+8 -8
View File
@@ -34,7 +34,7 @@ func getStreamStatus(data json.RawMessage) string {
func TestParticleService_CreateAndGet(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network first
@@ -73,7 +73,7 @@ func TestParticleService_CreateAndGet(t *testing.T) {
func TestParticleService_NestedParticles(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network
@@ -119,7 +119,7 @@ func TestParticleService_NestedParticles(t *testing.T) {
func TestParticleService_CustomVisibility(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network with a member
@@ -161,7 +161,7 @@ func TestParticleService_CustomVisibility(t *testing.T) {
func TestParticleService_UpdateAndDelete(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network
@@ -199,7 +199,7 @@ func TestParticleService_UpdateAndDelete(t *testing.T) {
func TestParticleService_ListRootParticles(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network
@@ -225,7 +225,7 @@ func TestParticleService_ListRootParticles(t *testing.T) {
func TestParticleService_OpenCloseStream(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network
@@ -273,7 +273,7 @@ func TestParticleService_OpenCloseStream(t *testing.T) {
func TestParticleService_NotAStream(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network
@@ -302,7 +302,7 @@ func TestParticleService_NotAStream(t *testing.T) {
func TestParticleService_AccessInheritance(t *testing.T) {
ctx := context.Background()
networkSvc := network.NewService(dbPool, nil, billing.Noop())
networkSvc := network.NewService(dbPool, nil, billing.Noop(), nil)
svc := particle.NewService(dbPool, networkSvc)
// Create a network with members