From 06ce7693f0544dddc3f4d6029bb8c552d7b99e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Fri, 29 Dec 2023 17:27:04 +0100 Subject: [PATCH] Propagate Authentication request attributes to augmentor --- .../identity/SecurityIdentityAugmentor.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/io/quarkus/security/identity/SecurityIdentityAugmentor.java b/src/main/java/io/quarkus/security/identity/SecurityIdentityAugmentor.java index 462dbfb..9f9b6fb 100644 --- a/src/main/java/io/quarkus/security/identity/SecurityIdentityAugmentor.java +++ b/src/main/java/io/quarkus/security/identity/SecurityIdentityAugmentor.java @@ -2,6 +2,8 @@ import io.smallrye.mutiny.Uni; +import java.util.Map; + /** * An interface that allows for a {@link SecurityIdentity} to be modified after creation. *

@@ -26,4 +28,17 @@ default int priority() { * @return A completion stage that will resolve to the modified identity */ Uni augment(SecurityIdentity identity, AuthenticationRequestContext context); + + + /** + * Augments a security identity to allow for modification of the underlying identity. + * + * @param identity The identity + * @param context A context object that can be used to run blocking tasks + * @param attributes All the authentication request attributes + * @return A completion stage that will resolve to the modified identity + */ + default Uni augment(SecurityIdentity identity, AuthenticationRequestContext context, Map attributes) { + return augment(identity, context); + } }