zitadel/internal/repository/project/eventstore.go
Tim Möhlmann 90b908c361
fix(oidc): don't push introspection client events (#8481)
# Which Problems Are Solved

Do not push secret succeeded and failed events for API and OIDC clients
on the introspection endpoint.
On instances where introspection was fequently called, the pushed events
created issues on duplicate primary keys, due to collisions on the
`sequence` column in the eventstore. As the event pusher retries on this
collision and we pushed above mentioned events async, it would create a
backpressure of concurrent pushers and effectively cripple an instance.

We considered that pushing these events have little value with regards
to the audit trail, as we do not push similar events when client
assertion is used. Also, before #7657 the events were defined, but not
pushed.

# How the Problems Are Solved

- Removed API secret check succeeded and faild event definitions
- Removed OIDC secret check succeeded and faild event definitions
- Push only Hash Updated event when needed

# Additional Changes

- None

# Additional Context

- Fixes https://github.com/zitadel/zitadel/issues/8479
- Closes https://github.com/zitadel/zitadel/issues/8430
- Intoduced in https://github.com/zitadel/zitadel/pull/7657
2024-08-28 18:19:50 +00:00

48 lines
4.2 KiB
Go

package project
import (
"github.com/zitadel/zitadel/internal/eventstore"
)
func init() {
eventstore.RegisterFilterEventMapper(AggregateType, ProjectAddedType, ProjectAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ProjectChangedType, ProjectChangeEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ProjectDeactivatedType, ProjectDeactivatedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ProjectReactivatedType, ProjectReactivatedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ProjectRemovedType, ProjectRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, MemberAddedType, MemberAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, MemberChangedType, MemberChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, MemberRemovedType, MemberRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, MemberCascadeRemovedType, MemberCascadeRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, RoleAddedType, RoleAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, RoleChangedType, RoleChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, RoleRemovedType, RoleRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantAddedType, GrantAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantChangedType, GrantChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantCascadeChangedType, GrantCascadeChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantDeactivatedType, GrantDeactivateEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantReactivatedType, GrantReactivatedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantRemovedType, GrantRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantMemberAddedType, GrantMemberAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantMemberChangedType, GrantMemberChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantMemberRemovedType, GrantMemberRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, GrantMemberCascadeRemovedType, GrantMemberCascadeRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationAddedType, ApplicationAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationChangedType, ApplicationChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationRemovedType, ApplicationRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationDeactivatedType, ApplicationDeactivatedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationReactivatedType, ApplicationReactivatedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, OIDCConfigAddedType, OIDCConfigAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, OIDCConfigChangedType, OIDCConfigChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, OIDCConfigSecretChangedType, OIDCConfigSecretChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, OIDCConfigSecretHashUpdatedType, eventstore.GenericEventMapper[OIDCConfigSecretHashUpdatedEvent])
eventstore.RegisterFilterEventMapper(AggregateType, APIConfigAddedType, APIConfigAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, APIConfigChangedType, APIConfigChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, APIConfigSecretChangedType, APIConfigSecretChangedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, APIConfigSecretHashUpdatedType, eventstore.GenericEventMapper[APIConfigSecretHashUpdatedEvent])
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationKeyAddedEventType, ApplicationKeyAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, ApplicationKeyRemovedEventType, ApplicationKeyRemovedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, SAMLConfigAddedType, SAMLConfigAddedEventMapper)
eventstore.RegisterFilterEventMapper(AggregateType, SAMLConfigChangedType, SAMLConfigChangedEventMapper)
}