You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/06/09 12:43:22 UTC

[isis] 06/09: ISIS-2727: refactors InteractionLayer

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2727
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 1a245c631b5ce0789fac53bacc083664bc624a7c
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 9 12:31:46 2021 +0100

    ISIS-2727: refactors InteractionLayer
    
    ... now derive Authentication from the provided InteractionContext
---
 .../isis/core/interaction/session/InteractionLayer.java     | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/core/interaction/src/main/java/org/apache/isis/core/interaction/session/InteractionLayer.java b/core/interaction/src/main/java/org/apache/isis/core/interaction/session/InteractionLayer.java
index ba5d76b..7b6a2c5 100644
--- a/core/interaction/src/main/java/org/apache/isis/core/interaction/session/InteractionLayer.java
+++ b/core/interaction/src/main/java/org/apache/isis/core/interaction/session/InteractionLayer.java
@@ -35,10 +35,10 @@ import lombok.NonNull;
 public class InteractionLayer {
 
 	@Getter private final IsisInteraction interaction;
-	 private final Authentication authentication;
+	@Getter private final InteractionContext interactionContext;
 
 	public Authentication getAuthentication() {
-		return authentication;
+		return Authentication.authenticationFrom(interactionContext).orElse(null);
 	}
 
 	public InteractionLayer(
@@ -50,12 +50,9 @@ public class InteractionLayer {
 		// meaning the Interaction that holds the stack containing this layer
 		this.interaction = interaction;
 
-		// binds given authentication to this layer
-		this.authentication = authentication;
-	}
-
-	public InteractionContext getInteractionContext() {
-	    return authentication.getInteractionContext();
+		// binds given interaction context (which normally would hold the Authentication in its attribute map)
+		// to this layer
+		this.interactionContext = interactionContext;
 	}
 
 }