Skip to content

Commit

Permalink
origins and ports do not need to establish auth relationships (#302)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Siwiec <[email protected]>
  • Loading branch information
rizzza authored Dec 21, 2023
1 parent d2bec89 commit 19a92fd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion internal/ent/schema/origin.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (Origin) Fields() []ent.Field {
Annotations(
entgql.Type("ID"),
entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput),
pubsubinfo.EventsHookAdditionalSubject("pool"),
),
}
}
Expand Down
1 change: 0 additions & 1 deletion internal/ent/schema/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (Port) Fields() []ent.Field {
Annotations(
entgql.Type("ID"),
entgql.Skip(entgql.SkipWhereInput, entgql.SkipMutationUpdateInput),
pubsubinfo.EventsHookAdditionalSubject("loadbalancer"),
),
}
}
Expand Down
20 changes: 0 additions & 20 deletions internal/manualhooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 19a92fd

Please sign in to comment.