Assignments Security 0

Handing In Assignments

You must hand in by using git

Hand In by git

  • Create an empty repo on bitbucket.org, gitlab.com, or github.com,
  • git push your local repo to the above remote repo.
  • For node assignments please put the line(s)

    node_modules/

    into your .gitignore file.

Send a mail to with:

  • The word 'handin <subjectname>' in the subject line of your mail
  • The url of your repo(s).

Assignment Security 0.0

In today's lesson you will find in Example 46.3 examples of extended schema attributes. You may copy the code from mongooseUser5.js to do the following.

  1. Try to violate the String constraint, and explain what happens. We are interested in the mongoose error message, and your interpretation of it.
  2. Try to violate the Number constraint, and explain what happens. We are interested in the mongoose error message, and your interpretation of it.
  3. Try to violate the Date constraint, and explain what happens. We are interested in the mongoose error message, and your interpretation of it.
  4. Lookup the keyword unique, and explain what it does. Make an experiment that proves yours and mongooses point.
  5. Try to violate the required constraint, and explain what happens. We are interested in the mongoose error message, and your interpretation of it.

Assignment Security 0.1

With the results of the previous assignment in mind change the Country object from last weeks project so that it uses extended constraints. Then test and iterate until error free. It is especially important that you consider the application of the unique constraint. Discuss your choice.

Once it works for country, repeat the process for all collections that may be inserted in your project.

Assignment Security 0.2

Sanitation means cleaning the user entered data for all things detrimental to our application. It could be as simple as making sure enough text was entered, but it could also mean checking that no script tags were entered in input fields or textareas.

Take some time to study https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/forms.

Take one of the forms from the project. Country gives you more experience, and decide on a sanitation scheme, then implement it. Try various aspects of express-validators functionality.