8000 Remove deprecated user event types by rmartinc · Pull Request #55790 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Remove deprecated user event types - #55790

Open
rmartinc wants to merge 1 commit into
keycloak:mainfrom
rmartinc:issue-32685
Open

rmartinc wants to merge 1 commit into
keycloak:mainfrom
rmartinc:issue-32685

Conversation

@rmartinc
@rmartinc rmartinc commented Dec 3, 2026
Copy link
Copy Markdown
Contributor

Closes #32685

Removal of the deprecated user event types. Added a migration method to remove the migrated events in the enabled events configuration. Besides there is a new UNKNOWN event type to return historical events stored in the database for the removed types. Tests modified to adequate to the new situation when only one event is triggered.

@rmartinc
rmartinc requested review from a team as code owners December 3, 2026 14:23
Copilot AI balanced review requested due to automatic review settings December 3, 2026 14:23
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing legacy event selections can silently drop intended audit records or enable all default event storage when the selection becomes empty.

4 open issues
What changed in this PR

Removes deprecated user events in favor of generic credential events, adds configuration migration, and represents historical removed events as UNKNOWN.

Changes:

  • Removes legacy event types and duplicate event emission.
  • Migrates enabled-event settings and adds historical-event fallback handling.
  • Updates documentation and tests for single credential events and notifications.
File Description
testsuite/​integration-arquillian/​tests/​base/​src/​test/​resources/​migration-test/​migration-realm-24.0.4.json Adds legacy event migration data.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​migration/​AbstractMigrationTest.java Checks obsolete selections are removed.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​forms/​ResetPasswordTest.java Removes legacy password-event assertions.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​forms/​MultipleTabsLoginTest.java Adjusts expected event counts.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​forms/​LevelOfAssuranceFlowTest.java Expects generic credential events.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​forms/​BruteForceTest.java Removes duplicate password-event expectation.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​federation/​storage/​UserStorageOTPTest.java Removes legacy OTP-event expectation.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​federation/​ldap/​LDAPProvidersIntegrationTest.java Expects one password-change event.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​federation/​kerberos/​KerberosStandaloneTest.java Expects the generic credential event.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionTotpSetupTest.java Uses generic events for session assertions.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionResetPasswordTest.java Removes legacy password-event assertions.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionPriorityTest.java Updates required-action event expectations.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionMultipleActionsTest.java Reads session details from one event.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​RequiredActionEmailVerificationTest.java Removes duplicate password-event assertion.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​AppInitiatedActionUpdateEmailWithVerificationTest.java Removes legacy password-event expectation.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​AppInitiatedActionTotpSetupTest.java Uses single credential-event assertions.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​AppInitiatedActionResetPasswordTest.java Expects one event and notification.
testsuite/​integration-arquillian/​tests/​base/​src/​test/​java/​org/​keycloak/​testsuite/​actions/​AppInitiatedActionDeleteCredentialTest.java Expects one removal event and notification.
tests/​base/​src/​test/​resources/​org/​keycloak/​tests/​migration/​migration-realm-19.0.3-Migration.json Adds legacy event migration data.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​migration/​AbstractMigrationTest.java Checks obsolete selections are removed.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​forms/​SSOTest.java Simplifies password-change event handling.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​forms/​ResetPasswordTest.java Removes legacy success and error assertions.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​forms/​RegisterWithEmailVerificationTest.java Expects one credential-update event.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​actions/​RequiredActionUpdatePasswordFederatedTest.java Removes legacy password-event expectation.
ssf/​transmitter/​src/​main/​java/​org/​keycloak/​ssf/​transmitter/​event/​SecurityEventTokenMapper.java Removes an obsolete explanatory comment.
services/​src/​main/​java/​org/​keycloak/​services/​resources/​account/​Constants.java Removes legacy exposed log events.
services/​src/​main/​java/​org/​keycloak/​events/​email/​EmailEventListenerProviderFactory.java Removes legacy notification event types.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​UpdateTotp.java Stops emitting duplicate OTP events.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​UpdatePassword.java Stops emitting legacy password events.
services/​src/​main/​java/​org/​keycloak/​authentication/​requiredactions/​DeleteCredentialAction.java Stops creating legacy OTP-removal events.
server-spi-private/​src/​main/​java/​org/​keycloak/​events/​EventType.java Removes deprecated types; adds UNKNOWN fallback.
quarkus/​runtime/​src/​test/​java/​org/​keycloak/​config/​EventOptionsTest.java Handles absent deprecation metadata.
quarkus/​runtime/​src/​main/​java/​org/​keycloak/​quarkus/​runtime/​configuration/​mappers/​EventPropertyMappers.java Excludes UNKNOWN from metric options.
quarkus/​config-api/​src/​main/​java/​org/​keycloak/​config/​EventOptions.java Removes obsolete deprecation metadata.
model/​storage-private/​src/​test/​java/​org/​keycloak/​migration/​migrators/​MigrateTo27_0_0Test.java Adapts migration tests and realm stubs.
model/​storage-private/​src/​main/​java/​org/​keycloak/​migration/​migrators/​MigrateTo27_0_0.java Removes obsolete enabled-event selections.
model/​jpa/​src/​main/​java/​org/​keycloak/​events/​jpa/​JpaEventStoreProvider.java Converts historical removed types to UNKNOWN.
js/​libs/​keycloak-admin-client/​src/​defs/​eventTypes.ts Removes deprecated event union members.
docs/​documentation/​upgrading/​topics/​changes/​changes-26_7_0.adoc Documents removal and historical-event behavior.
docs/​documentation/​server_admin/​topics/​events/​login.adoc Removes deprecated event descriptions.
docs/​documentation/​server_admin/​topics/​admin-cli.adoc Updates event configuration examples.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:51
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration can cause an emptied explicit event selection to save all default event types, unexpectedly persisting login and other events.

2 open issues
4 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:57
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The historical-event fallback lacks regression coverage verifying that removed event types return UNKNOWN while preserving error and details fields.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:03
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because the published review omits a finding about undocumented server-option changes that can cause upgrade validation failures and are not handled by realm migration.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 4, 2026 11:42
@rmartinc
rmartinc commented Dec 4, 2026
Copy link
Copy Markdown
Contributor Author

Rebased to resolve the conflicts. Let's see the tests.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the removal of deprecated user event types.

No open issues 🎉

Review effort: Balanced

mabartos
mabartos previously approved these changes Dec 4, 2026
@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmartinc LGTM, thanks!

"jboss-logging"
],
"enabledEventTypes": [],
"enabledEventTypes": [ "UPDATE_CONSENT_ERROR", "UPDATE_TOTP", "UPDATE_CREDENTIAL", "IMPERSONATE_ERROR", "CUSTOM_REQUIRED_ACTION", "RESTART_AUTHENTICATION", "VERIFIABLE_CREDENTIAL_OFFER_REQUEST", "IMPERSONATE", "LOGIN", "CLIENT_INITIATED_ACCOUNT_LINKING", "OAUTH2_EXTENSION_GRANT", "USER_DISABLED_BY_PERMANENT_LOCKOUT", "VERIFIABLE_CREDENTIAL_REQUEST", "REMOVE_CREDENTIAL_ERROR", "TOKEN_EXCHANGE", "REGISTER", "DELETE_ACCOUNT_ERROR", "VERIFIABLE_CREDENTIAL_OFFER_REQUEST_ERROR", "IDENTITY_PROVIDER_LINK_ACCOUNT", "USER_DISABLED_BY_TEMPORARY_LOCKOUT", "DELETE_ACCOUNT", "UPDATE_PASSWORD", "IDENTITY_PROVIDER_FIRST_LOGIN", "VERIFY_EMAIL", "CLIENT_LOGIN_ERROR", "RESTART_AUTHENTICATION_ERROR", "EXECUTE_ACTIONS", "REMOVE_FEDERATED_IDENTITY_ERROR", "TOKEN_EXCHANGE_ERROR", "VERIFIABLE_CREDENTIAL_PRE_AUTHORIZED_GRANT", "FEDERATED_IDENTITY_OVERRIDE_LINK", "SEND_IDENTITY_PROVIDER_LINK_ERROR", "VERIFIABLE_CREDENTIAL_CREATE_OFFER", "JWT_AUTHORIZATION_GRANT_ERROR", "VERIFIABLE_CREDENTIAL_PRE_AUTHORIZED_GRANT_ERROR", "EXECUTE_ACTION_TOKEN_ERROR", "OAUTH2_EXTENSION_GRANT_ERROR", "SEND_VERIFY_EMAIL", "EXECUTE_ACTIONS_ERROR", "OAUTH2_DEVICE_CODE_TO_TOKEN", "OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR", "REVOKE_GRANT_ERROR", "UPDATE_EMAIL_ERROR", "INVITE_ORG_ERROR", "UPDATE_PROFILE", "VERIFIABLE_CREDENTIAL_REQUEST_ERROR", "SEND_IDENTITY_PROVIDER_LINK", "SEND_VERIFY_EMAIL_ERROR", "CLIENT_INITIATED_ACCOUNT_LINKING_ERROR", "OAUTH2_DEVICE_AUTH_ERROR", "REMOVE_TOTP_ERROR", "VERIFY_EMAIL_ERROR", "CLIENT_UPDATE", "JWT_AUTHORIZATION_GRANT", "UPDATE_TOTP_ERROR", "VERIFY_PROFILE", "GRANT_CONSENT_ERROR", "SEND_RESET_PASSWORD", "GRANT_CONSENT", "VERIFY_PROFILE_ERROR", "REMOVE_TOTP", "REVOKE_GRANT", "LOGIN_ERROR", "CLIENT_LOGIN", "RESET_PASSWORD_ERROR", "CODE_TO_TOKEN_ERROR", "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR", "UPDATE_PROFILE_ERROR", "OAUTH2_DEVICE_VERIFY_USER_CODE", "UPDATE_PASSWORD_ERROR", "IDENTITY_PROVIDER_LOGIN", "AUTHREQID_TO_TOKEN", "LOGOUT", "CLIENT_REGISTER", "CLIENT_DELETE", "FEDERATED_IDENTITY_LINK_ERROR", "CLIENT_DELETE_ERROR", "PERMISSION_TOKEN", "UPDATE_CREDENTIAL_ERROR", "OAUTH2_DEVICE_AUTH", "REMOVE_FEDERATED_IDENTITY", "IDENTITY_PROVIDER_POST_LOGIN", "VERIFIABLE_CREDENTIAL_CREATE_OFFER_ERROR", "IDENTITY_PROVIDER_LINK_ACCOUNT_ERROR", "FEDERATED_IDENTITY_OVERRIDE_LINK_ERROR", "UPDATE_EMAIL", "REGISTER_ERROR", "LOGOUT_ERROR", "CLIENT_UPDATE_ERROR", "AUTHREQID_TO_TOKEN_ERROR", "CLIENT_REGISTER_ERROR", "FEDERATED_IDENTITY_LINK", "INVITE_ORG", "IDENTITY_PROVIDER_LOGIN_ERROR", "RESET_PASSWORD", "REMOVE_CREDENTIAL", "UPDATE_CONSENT", "SEND_RESET_PASSWORD_ERROR", "CUSTOM_REQUIRED_ACTION_ERROR", "IDENTITY_PROVIDER_POST_LOGIN_ERROR", "CODE_TO_TOKEN", "IDENTITY_PROVIDER_FIRST_LOGIN_ERROR" ],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really test the 19 version AFAIK, but we can have these changes here.

@rmartinc rmartinc Dec 4, 2026 •
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is used by JsonFileImport1903MigrationTest. I checked it failed before doing the changes and checked the events were there.

@mabartos
mabartos commented Dec 4, 2026
Copy link
Copy Markdown
Member

@rmartinc There's another conflict

Closes keycloak#32685

Signed-off-by: rmartinc <rmartinc@redhat.com>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 15:56
@rmartinc
rmartinc commented Dec 4, 2026
Copy link
Copy Markdown
Contributor Author

Rebased!

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the transition from deprecated user events to generic credential events.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated event types for password/otp update or removal

3 participants

0