From 19a92fd53722885b108119069f21c66b7a5e3d4a Mon Sep 17 00:00:00 2001 From: Matt Siwiec Date: Thu, 21 Dec 2023 11:17:09 -0700 Subject: [PATCH] origins and ports do not need to establish auth relationships (#302) Signed-off-by: Matt Siwiec --- internal/ent/schema/origin.go | 1 - internal/ent/schema/port.go | 1 - internal/manualhooks/hooks.go | 20 -------------------- 3 files changed, 22 deletions(-) diff --git a/internal/ent/schema/origin.go b/internal/ent/schema/origin.go index 1c56e388a..a7c88c2e8 100644 --- a/internal/ent/schema/origin.go +++ b/internal/ent/schema/origin.go @@ -72,7 +72,6 @@ func (Origin) Fields() []ent.Field { Annotations( entgql.Type("ID"), entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput), - pubsubinfo.EventsHookAdditionalSubject("pool"), ), } } diff --git a/internal/ent/schema/port.go b/internal/ent/schema/port.go index 2c01d2bbd..47fe46f3c 100644 --- a/internal/ent/schema/port.go +++ b/internal/ent/schema/port.go @@ -58,7 +58,6 @@ func (Port) Fields() []ent.Field { Annotations( entgql.Type("ID"), entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput), - pubsubinfo.EventsHookAdditionalSubject("loadbalancer"), ), } } diff --git a/internal/manualhooks/hooks.go b/internal/manualhooks/hooks.go index b3f859028..b95f89353 100644 --- a/internal/manualhooks/hooks.go +++ b/internal/manualhooks/hooks.go @@ -440,11 +440,6 @@ func OriginHooks() []ent.Hook { } additionalSubjects = append(additionalSubjects, pool_id) - relationships = append(relationships, events.AuthRelationshipRelation{ - Relation: "pool", - SubjectID: pool_id, - }) - if ok { cv_pool_id = fmt.Sprintf("%s", fmt.Sprint(pool_id)) pv_pool_id := "" @@ -569,11 +564,6 @@ func OriginHooks() []ent.Hook { } } - relationships = append(relationships, events.AuthRelationshipRelation{ - Relation: "pool", - SubjectID: dbObj.PoolID, - }) - // we have all the info we need, now complete the mutation before we process the event retValue, err := next.Mutate(ctx, m) if err != nil { @@ -1002,11 +992,6 @@ func PortHooks() []ent.Hook { }) } - relationships = append(relationships, events.AuthRelationshipRelation{ - Relation: "loadbalancer", - SubjectID: load_balancer_id, - }) - msg := events.ChangeMessage{ EventType: eventType(m.Op()), SubjectID: objID, @@ -1094,11 +1079,6 @@ func PortHooks() []ent.Hook { additionalSubjects = append(additionalSubjects, dbObj.Edges.LoadBalancer.OwnerID) additionalSubjects = append(additionalSubjects, dbObj.Edges.LoadBalancer.ProviderID) - relationships = append(relationships, events.AuthRelationshipRelation{ - Relation: "loadbalancer", - SubjectID: dbObj.LoadBalancerID, - }) - // we have all the info we need, now complete the mutation before we process the event retValue, err := next.Mutate(ctx, m) if err != nil {