From 65f6926f45f9f91a1e210026ae536908aa552f59 Mon Sep 17 00:00:00 2001 From: Luca Filipozzi Date: Tue, 9 Apr 2024 09:34:32 -0700 Subject: [PATCH] bump to 1.7.0 --- .../events/login/LoginEventListenerProvider.java | 2 +- .../login/LoginEventListenerProviderFactory.java | 10 ++++------ pom.xml | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProvider.java b/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProvider.java index 0a53a62..0c04b12 100644 --- a/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProvider.java +++ b/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProvider.java @@ -29,7 +29,7 @@ public void onEvent(Event event) { if (event.getType() == EventType.LOGIN) { RealmModel realm = session.realms().getRealm(event.getRealmId()); UserModel user = session.users().getUserById(realm, event.getUserId()); - LOG.warnf( + LOG.tracef( "setting %s on realm='%s' user='%s' userId='%s'", ATTRIBUTE_NAME, realm.getName(), user.getUsername(), user.getId()); user.setSingleAttribute(ATTRIBUTE_NAME, Long.toString(Time.currentTimeMillis())); diff --git a/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProviderFactory.java b/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProviderFactory.java index 68c63b0..877cea6 100644 --- a/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProviderFactory.java +++ b/login-event-listener-provider/src/main/java/com/github/lucafilipozzi/keycloak/events/login/LoginEventListenerProviderFactory.java @@ -49,17 +49,15 @@ public void init(Config.Scope config) { @Override public void postInit(KeycloakSessionFactory factory) { - LOG.error("postInit() - entry"); factory.register( event -> { if (event instanceof PostMigrationEvent) { - LOG.error("postInit() - registering task"); + LOG.debug("registering disable-users-task"); KeycloakSession session = factory.create(); TimerProvider timer = session.getProvider(TimerProvider.class); timer.scheduleTask(this::disableUsers, taskInterval, "disable-users-task"); } }); - LOG.error("postInit() - entry"); } @Override @@ -86,7 +84,7 @@ private void disableUsers(KeycloakSession session) { .forEach( realm -> { if (realm.getEventsListenersStream().noneMatch(x -> x.equals(PROVIDER_ID))) { - LOG.warnf( + LOG.debugf( "realm='%s' does not have 'Login Event Listener' enabled", realm.getName()); return; } @@ -94,7 +92,7 @@ private void disableUsers(KeycloakSession session) { PasswordPolicy passwordPolicy = realm.getPasswordPolicy(); if (passwordPolicy == null || !passwordPolicy.getPolicies().contains("disable-users-password-policy")) { - LOG.warnf( + LOG.debugf( "realm='%s' does not have 'Disable Users' password policy set", realm.getName()); return; @@ -104,7 +102,7 @@ private void disableUsers(KeycloakSession session) { long gracePeriodMillis = gracePeriodDays * DAYS_TO_MILLIS; - LOG.warnf( + LOG.infof( "checking realm='%s' for expired passwords or inactive accounts exceeding %d day(s)", realm.getName(), gracePeriodDays); diff --git a/pom.xml b/pom.xml index c28d027..74dc73d 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ - 1.6.3 + 1.7.0 LucaFilipozzi UTF-8 18.0.2