Skip to content

Commit

Permalink
Fix minor typo (#42)
Browse files Browse the repository at this point in the history
* Fix minor typo

> * Let users use misspelled flags.
> 
> There were some... unfortunate... spellings in the initial
> versions of this code. This PR should let users continue to
> use the misspellings for a short while (until we bump the
> major version) and integrate with @duongnt's fixes.
> 
> Signed-off-by: Tom Kelley <[email protected]>

Co-authored-by: Tom Kelley <[email protected]>
  • Loading branch information
duongnt and distortedsignal authored Feb 27, 2020
1 parent b319e77 commit 476dccc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ OTHER DEALINGS IN THE SOFTWARE.
* @mwilbz for making a great issue and patch
* @itsnagaraj for making a great issue, providing a lot of thought and code, and being very patient with development of the project
* @killerwhile for jumping in and making some really neat additions
* @duongnt for being very patient and checking the spelling in the code and in the docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ c.SAMLAuthenticator.idp_timezone = 'US/Eastern'
c.SAMLAuthenticator.shutdown_on_logout = True

# Don't send the user to the SLO address on logout
c.SAMLAuthenticator.slo_forwad_on_logout = False
c.SAMLAuthenticator.slo_forward_on_logout = False

# A corporate entity has specified a new entity id for this JupyterHub instance
c.SAMLAuthenticator.entity_id = '6d112afe-0544-4e8e-8b7e-21e6f57763f9'
Expand Down
12 changes: 9 additions & 3 deletions samlauthenticator/samlauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ class SAMLAuthenticator(Authenticator):
class, this should be on the Authenticator.
'''
)
slo_forwad_on_logout = Bool(
slo_forward_on_logout = Bool(
default_value=True,
allow_none=False,
config=True,
help='''
To prevent forwarding users to the SLO URI on logout,
set this parameter to False like so:
c.SAMLAuthenticator.slo_forwad_on_logout = False
c.SAMLAuthenticator.slo_forward_on_logout = False
'''
)
entity_id = Unicode(
Expand Down Expand Up @@ -746,7 +746,13 @@ async def get(logout_handler_self):
if logout_handler_self.current_user:
logout_handler_self._backend_logout_cleanup(logout_handler_self.current_user.name)

if authenticator_self.slo_forwad_on_logout:
# This is a little janky, but there was a misspelling in a prior version
# where someone could have set the wrong flag because of the documentation.
# We will honor the misspelling until we rev the version, and then we will
# break backward compatibility.
forward_on_logout = True if authenticator_self.slo_forward_on_logout else False
forwad_on_logout = True if authenticator_self.slo_forwad_on_logout else False
if forward_on_logout or forwad_on_logout:
authenticator_self._get_redirect_from_metadata_and_redirect('md:SingleLogoutService',
logout_handler_self)
else:
Expand Down

0 comments on commit 476dccc

Please sign in to comment.