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

Security fix: no more matricola moving #108

Merged
merged 4 commits into from
Jul 14, 2014
Merged

Security fix: no more matricola moving #108

merged 4 commits into from
Jul 14, 2014

Conversation

alemela
Copy link
Contributor

@alemela alemela commented Jul 9, 2014

We used to pass also 'matricola' every time we edit info.
Now 'matricola' is the login name and can't be modified via API.

@alemela
Copy link
Contributor Author

alemela commented Jul 9, 2014

There is an unexpected bug during "signup" workflow. Please, wait merge until fixed.

@alemela
Copy link
Contributor Author

alemela commented Jul 14, 2014

Ok, now this is a full working patch. When you have time you can start to have a look.

@@ -86,12 +85,13 @@ exports.handleMatricola = function (request, response) {

try {
studentInfo.Token = crypto.randomBytes(20).toString("hex");
delete studentInfo.Matricola;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should explain why here you need to delete Matricola.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When a user send a request for changing his data, we identify him with login status. If he can modify, we read all previous data, where is present 'matricola' and start the dance between functions. But we don't want to make 'matricola' editable, so I remove it from the object with all (editable) data.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean that the matricola is present on disk because we allowed it earlier? If so, I suggest to automatically remove the matricola from all files on disk, rather than adding ad-hoc hacks for cleansing the object model opportunistically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we remove matricola from all students' datasets probably then we have to write an hacks to get matricola number from the file name because we use it in different places.

@bassosimone
Copy link
Contributor

Thanks, merging!

bassosimone added a commit that referenced this pull request Jul 14, 2014
Security fix: no more matricola moving
@bassosimone bassosimone merged commit 49e2e21 into master Jul 14, 2014
@bassosimone bassosimone deleted the devel_20140709 branch July 14, 2014 15:16
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.

2 participants