From 1aa17e96b0a5d6e981f3cee93e4d52567d4314c7 Mon Sep 17 00:00:00 2001 From: jgomer2001 Date: Fri, 31 Jan 2025 10:53:26 -0500 Subject: [PATCH] fix: align script wrt latest AS consent updates #10766 Signed-off-by: jgomer2001 --- .../AgamaConsentGathering.py | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/script-catalog/consent_gathering/AgamaConsentGathering.py b/docs/script-catalog/consent_gathering/AgamaConsentGathering.py index 7709dbc06c8..53948677ec4 100644 --- a/docs/script-catalog/consent_gathering/AgamaConsentGathering.py +++ b/docs/script-catalog/consent_gathering/AgamaConsentGathering.py @@ -75,25 +75,20 @@ def prepareForStep(self, step, context): print "Agama-Consent. Failed to retrieve session_id" return False - cesar = session.getSessionAttributes() - param = cesar.get("agama_flow") + sessionId = session.getId() + # print "Session id is %s" % sessionId + param = context.getSessionAttributes().get("consent_flow") if not param: - param = self.extractAgamaFlow(cesar.get("acr_values")) + print "Agama-Consent. 'consent_flow' session attribute missing" + return False - if not param: - print "Agama-Consent. Unable to determine the Agama flow to launch. Check the docs" - return False - (qn, ins) = self.extractParams(param) if qn == None: print "Agama-Consent. Unable to determine the Agama flow to launch. Check the docs" return False try: - sessionId = session.getId() - # print "==================================== %s" % sessionId - bridge = CdiUtil.bean(NativeJansFlowBridge) running = bridge.prepareFlow(sessionId, qn, ins, False, self.enterUrl) @@ -120,13 +115,7 @@ def getPageForStep(self, step, context): return "/" + self.enterUrl # Misc routines - - def extractAgamaFlow(self, acr): - prefix = "agama_" - if acr and acr.startswith(prefix): - return acr[len(prefix):] - return None - + def extractParams(self, param): # param must be of the form QN-INPUT where QN is the qualified name of the flow to launch