From b8aecffae103d01af4b53bdbfa8805b466bdf5ff Mon Sep 17 00:00:00 2001 From: Marcello Romani Date: Mon, 8 Apr 2024 17:02:55 +0100 Subject: [PATCH] Feature/saml login args check (#89) * should fail if either of ther required arguments is None * remove unneeded interpolation prefix * clearer error message if one or both params are missing --- gremlinapi/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gremlinapi/__init__.py b/gremlinapi/__init__.py index 84428d0..de30b20 100644 --- a/gremlinapi/__init__.py +++ b/gremlinapi/__init__.py @@ -238,8 +238,8 @@ def saml_login(email=GremlinAPIConfig.user, saml_assertion=None, relay_state=Non "Received user without value being present in config, updating config to match." ) GremlinAPIConfig.user = email - if not saml_assertion and relay_state: - error_msg = f"Expecting a SAML assertion and relay state, received none" + if not saml_assertion or not relay_state: + error_msg = "Both saml_assertion and relay_state arguments must be specified" log.fatal(error_msg) raise GremlinParameterError(error_msg) acs_response = GremlinAPISaml.acs(