Challenge Overview

Describe what you want to accomplish. 
 

A previous challenge has implemented a set of REST APIs for handling video assets, including storing them and managing them (create, retrieve, update, delete).  This challenge will add new formats to the service layer for retrieving video data and will add some security to the API

Existing API

The existing Node application and deployment details are in Gitlab, and the URL to the repository can be found in the forum.

Feed formats

This challenge will add new formats to the response of the /videos GET API request (the other admin-like functionality is not in scope).  We want to support future clients that may not want JSON format.

The formats added will be:

* Atom
* RSS
* XML

The service will determine the response format based on the Content-Type header in the request.  Here are the MIME types expected:

* Atom - application/atom+xml
* RSS - application/rss+xml
* XML - application/xml

RSS / Atom:

For Atom and RSS feeds, we should ensure that the various values expected in the format are filled with data from the datastore.  Note that not all data for each video may fit in the format, so it is acceptable to leave some data out.

Filters / pagination:

The filters supported in the URL request should work with the new data formats.  The pagination should work with the XML format, but we will only honor the pageSize parameter for RSS and Atom.

New security

Right now, there's no security on the /videos endpoint for updating, creating, or deleting videos.  We want to limit this functionality to only admin users that are logged in, so please update the service layer to enforce authorization on those endpoints.  The 401 HTTP status code should be returned if an unauthenticated request is made.

This change should not affect the GET request to /videos.
README

Make sure the README is updated with verification information about the new formats.

Unit tests

As with the other functionality, unit tests are required for these new formats.

Heroku deploy

Make sure the Heroku deployment information is up-to-date and that you keep the package.json up to date as well.  Don't expect the deployment to be anything other than "npm install" / "npm start" locally and "git push heroku master" for Heroku deployment.

Submission format

Your submission should be provided as a Git patch file against the commit hash mentioned in the forum.  MAKE SURE TO TEST YOUR PATCH FILE!
 


Final Submission Guidelines

Please see above

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30054693