-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Forward
newsletter
user attribute to Redis
- Loading branch information
Showing
4 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/openfoodfacts/github/keycloak/utils/UserAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package openfoodfacts.github.keycloak.utils; | ||
|
||
public class UserAttributes { | ||
public static final String NEWSLETTER = "newsletter"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ void testRegisterEventIsForwarded() { | |
openfoodfacts.github.keycloak.events.RedisEventListenerProviderFactory factory = new openfoodfacts.github.keycloak.events.RedisEventListenerProviderFactory(); | ||
factory.init(Utils.createScope(redisURI)); | ||
|
||
KeycloakSessionFactory sessionFactory = Utils.createKeycloakSessionFactory(true, false); | ||
KeycloakSessionFactory sessionFactory = Utils.createKeycloakSessionFactory(true, false, "subscribe"); | ||
KeycloakSession session = sessionFactory.create(); | ||
factory.postInit(sessionFactory); | ||
EventListenerProvider eventListenerProvider = factory.create(session); | ||
|
@@ -74,6 +74,7 @@ public EventType getType() { | |
Assertions.assertEquals("[email protected]", fields.get("email")); | ||
Assertions.assertEquals("theUserName", fields.get("userName")); | ||
Assertions.assertEquals("open-products-facts", fields.get("realm")); | ||
Assertions.assertEquals("subscribe", fields.get("newsletter")); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters