Explore how to do type and data validation for improved sanitization of your data.
- [Instructor] When handling data on your server…the best first line of defense is to do validation…and type assertion.…This way, the data sent is already sanitized…to be of a certain type…and you avoid sending dangerous scripts to the server.…Let me demonstrate.…So go into the project and open the folder called models…and then click on crmModel.…And this is where we actually define the type of our schema.…So right now if you take a look at firstName,…lastName, email, company, phone, and created_date…we expect a type.…
So we expect a type of String, String, and email for String…and then Number for phone and then we expect a type Date…for the created_date.…So if we pass a number to firstName,…right there and then it's gonna break.…So we're not gonna be able to pass a number to String…or a string to the Number here.…So this is one of the first thing you need to do.…So when you define your schema,…make sure you define a type for each of your properties…inside of your object that you are passing…and sending to the server.…
- OWASP resources and security threats
- Cross-site scripting and denial of service attacks
- Managing packages in a Node.js app
- Adding two-factor and read-only tokens with npm
- Using prepared statements for SQL/NoSQL
- Encrypting user data and session management
- Adding HTTPS protocol to an application
- Using cookie attributes
- Tools for testing
Skill Level Intermediate
Node.js: Deploying Applicationswith Kirsten Hunter1h 24m Intermediate
Node.js: Debugging and Performance Tuningwith Jon Peck2h 44m Intermediate
1. Security Overview
OWASP top 10 in Node.js2m 22s
2. Best Practices: Packages
3. Best Practices: Data
4. Best Practices: Server Level
5. Tools for Testing
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.