fix: query organization directly from event store (#10463)

Querying an organization by id allowed to trigger the org projection.
This could lead to performance impacts if the projection gets triggered
too often.

Instead of executing the trigger the organization by id query is now
always executed on the eventstore and reduces all event types required
of the organization requested.

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Silvan
2025-08-12 11:37:08 +02:00
committed by GitHub
parent 7fff529777
commit 427cbe06f3
16 changed files with 39 additions and 77 deletions

View File

@@ -261,7 +261,7 @@ func (s *Server) checkOrgScopes(ctx context.Context, resourceOwner string, scope
if slices.ContainsFunc(scopes, func(scope string) bool {
return strings.HasPrefix(scope, domain.OrgDomainPrimaryScope)
}) {
org, err := s.query.OrgByID(ctx, false, resourceOwner)
org, err := s.query.OrgByID(ctx, resourceOwner)
if err != nil {
return nil, err
}