Skip to content

Commit

Permalink
Merge d349f68 into b2c6cfc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin-Sun-tts committed Sep 28, 2023
2 parents b2c6cfc + d349f68 commit bf60871
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/mytest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zope.interface==4.3.2
5 changes: 2 additions & 3 deletions bin/setup-ckan.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ then
pip install -r requirement-setuptools.txt
fi

if [ $CKANVERSION == '2.7' ]
if [ $CKANVERSION == '2.9' ]
then
echo "Installing setuptools"
pip install setuptools==39.0.1
sed -i 's/zope.interface==4.3.2/zope.interface>5.0.0/g' requirements.txt
fi

python setup.py develop
Expand Down
10 changes: 10 additions & 0 deletions ckanext/saml2auth/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ def update_config(self, config_):

# IAuthenticator

def identify(self):
try:
if g.userobj and not session.get('last_active'):
log.info('User {0}<{1}> logged in successfully{2}.'.format(
g.userobj.name, g.userobj.email,
' via saml' if session.get('_saml_session_info') else ''
))
except AttributeError:
log.info(u'No user defined!')

def logout(self):

response = _perform_slo()
Expand Down
2 changes: 1 addition & 1 deletion ckanext/saml2auth/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
def test_generate_password():
password = h.generate_password()
assert len(password) == 8
assert type(password) == str
assert isinstance(password, str)


def test_default_login_disabled_by_default():
Expand Down
2 changes: 0 additions & 2 deletions ckanext/saml2auth/views/saml2auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ def _log_user_into_ckan(resp):
user_id = g.userobj.name
set_repoze_user(user_id, resp)

log.info(u'User {0}<{1}> logged in successfully'.format(g.userobj.name, g.userobj.email))


def saml2login():
u'''Redirects the user to the
Expand Down

0 comments on commit bf60871

Please sign in to comment.