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

Accounts: Account takeover edge cases #27657

Merged
merged 4 commits into from Mar 22, 2019

Conversation

islemaster
Copy link
Contributor

@islemaster islemaster commented Mar 22, 2019

(FND-320) Implements three new account takeover edge cases:

Teacher taking over another teacher account that has no progress but does own sections

Given I am a teacher
And there exists another teacher
  having credential X
  and having no activity
  and owning section Y
When I link credential X
Then the other teacher is destroyed
And I own section Y instead of the other teacher

Teacher taking over a student account that has no progress but is enrolled in sections

Given I am a teacher
And there exists a student
  having credential X
  and having no activity
  and enrolled in section Y
When I link credential X
Then the student is destroyed
And I am enrolled in section Y instead of the student

Student taking over a teacher account that has no progress

Given I am a student
And there exists a teacher
  having credential X
  and having no activity
When I link credential X
Then linking credential X fails with a message about it already being in use by another account.

I've captured these cases as tests and updated our implementation to match.

@islemaster islemaster requested review from Hamms, bethanyaconnor, dju90 and maddiedierker and removed request for Hamms March 22, 2019 20:28
Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

great test cases! 🥇 out of curiosity, how did we discover these edge cases?

@islemaster
Copy link
Contributor Author

Poorva brought up this case in an email yesterday afternoon:

Currently, if you have a Clever account with no progress and then try to connect that same Clever login to another Code.org account, you can. The original Clever Code.org account will get deleted. This is intentional and desired except that we should also be checking if the teacher has sections. We aren't doing that, meaning that if the teacher has no progress but has students with progress, then the student accounts will get deleted.

It's unclear whether this has ever actually happened, but it seems to be possible and was easy to fix (the first case listed in the PR description). The other two occurred to me while fixing up the first case.

@islemaster islemaster merged commit f732b45 into staging Mar 22, 2019
@islemaster islemaster deleted the section-ownership-transfer-on-takeover branch March 22, 2019 22:24
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.

None yet

3 participants