Skip to content

Commit

Permalink
Feature/saml login args check (#89)
Browse files Browse the repository at this point in the history
* should fail if either of ther required arguments is None

* remove unneeded interpolation prefix

* clearer error message if one or both params are missing
  • Loading branch information
marcelloromani authored Apr 8, 2024
1 parent a4f2073 commit b8aecff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gremlinapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b8aecff

Please sign in to comment.