Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use audit logger for logging of logins in external_auth... #511

Merged
merged 1 commit into from
Aug 1, 2013

Conversation

brianhw
Copy link
Contributor

@brianhw brianhw commented Jul 29, 2013

... and student apps. Move test_login to student app. Improve conditional tests for Shibboleth login logic.

@cpennington

@sefk , can someone from edX West review this in @jbau 's absence? The logging calls themselves should have little effect, but this PR also includes changes to the Shibboleth-specific conditional logic (to test the external domain rather than just relying on a setting). Jason acknowledged one of these changes, but there are a few others. It would be good to get a manual test of the branch to confirm that the Shibboleth code paths still work.

@brianhw
Copy link
Contributor Author

brianhw commented Jul 29, 2013

@jarv You also asked to review this.

@@ -93,6 +93,13 @@ def test_exception_shib_login(self):
self.assertEqual(no_idp_response.status_code, 403)
self.assertIn("identity server did not return your ID information", no_idp_response.content)

def _assert_shib_login_is_logged(self, audit_log_call, remote_user):
"""Asserts that shibboleth login attempt is being logged"""
name, args, _kwargs = audit_log_call
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps call this fn_name rather than name, just to make it clearer? I found the assertion confusing.

@cpennington
Copy link
Contributor

Only other thing I can think of is to check w/ Studio (@cahrens?) about logging of login attempts via the django admin interface.

@cpennington
Copy link
Contributor

👍

@brianhw
Copy link
Contributor Author

brianhw commented Jul 30, 2013

For now, I have added handlers for the user_logged_in and user_logged_out signals. This covers the case of successful login/logout through the admin console (in studio), as well as the regular LMS calls to login and logout.
A future story on rate limiting logins should allow us to capture the failed attempts as well.

…uth and student apps. Move test_login to student app. Improve conditional tests for Shibboleth login logic. (Does not include reconfiguring log settings.)
@brianhw
Copy link
Contributor Author

brianhw commented Jul 31, 2013

@jarv This no longer includes the audit log definition. That has been separated out into PR 539 so that this can be merged to master without losing any logging. The configuration can then be put in place for the separate "audit" log file by devops, and then PR 539 can be committed.

@brianhw
Copy link
Contributor Author

brianhw commented Aug 1, 2013

@dianakhuang Can you please review this as well.

@@ -1087,7 +1098,7 @@ def change_email_request(request):
subject = ''.join(subject.splitlines())
message = render_to_string('emails/email_change.txt', d)

res = send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [pec.new_email])
_res = send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [pec.new_email])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it doesn't seem like we're using these variables anywhere, was there a reason why you just added underscores as opposed to removing them?

@dianakhuang
Copy link
Contributor

That was my only comment. Otherwise, 👍

If you want to merge this first, I can handle the merge conflicts on my branch.

brianhw added a commit that referenced this pull request Aug 1, 2013
Use audit logger for logging of logins in external_auth...
@brianhw brianhw merged commit a628b62 into master Aug 1, 2013
@brianhw brianhw deleted the feature/brian/audit-log branch August 1, 2013 21:08
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
e-kolpakov referenced this pull request in open-craft/edx-platform Sep 17, 2015
…visioning

Automatic account provisioning
kawaguchi-ks added a commit to nttks/edx-platform that referenced this pull request Nov 25, 2015
…cms-env-for-load-tab

Mod cms env for loading InstructorDashboardTab openedx#434
diegomillan pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 23, 2016
…ent-ids-studio

Display unobtrusive component locations in studio
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants