GithubHelp home page GithubHelp logo

a-stanisz / cinephile-diary Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 796 KB

A movie service that creates, stores, and presents movie records of the authenticated user

Dockerfile 2.92% JavaScript 97.08%

cinephile-diary's People

Contributors

a-stanisz avatar

Watchers

 avatar

cinephile-diary's Issues

Remove redundant validation

Not sure if the decoded token (user data) needs additional ajv-validation since jwt.verify method is some kind of validation itself

Cover remaining use cases

User stories:

  • basic-user/premium-user adds a new movie ✔
  • basic-user tries to add a new movie while having the service usage limit already reached ✔
  • basic-user/premium-user provides incorrect title (pass error info as a properly structured error response) ❌
  • basic-user/premium-user provides a title that already exists in the database (do not duplicate entries - maybe use IMDb ID) ❌
  • basic-user/premium-user gets the list of user's entries (filter movies array for only needed data, do not expose db-specific data) ❌

Validate requests payload

Implement validation of requests payload.

Example solution: define JSON Schema for allowed payloads and use Ajv validator.

Edit 1:
What is to validate within the request payload:

  • if decoded token taken from the request's auth header is the user data and complies with the user schema
  • if the request's body complies with the movie schema and therefore doesn't consist of any excessive data

Edit 2:
Consider if the token even needs validation, while jwt.verify method is some kind of validation itself 🤔

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.