A Symfony project created on July 16, 2015, 1:34 pm.
Prerequisite:
- composer install
- Populate Database => php app/console doctrine:database:create
- Populate Table => php app/console doctrine:schema:update --force
-
Build a REST Server for a password manager. We recommend using FOSRestBundle (https://github.com/FriendsOfSymfony/FOSRestBundle), documentation can be found here: http://symfony.com/doc/master/bundles/FOSRestBundle/index.html (Done)
-
Authentication is done by providing a http header (X-ACCESS-TOKEN). The access token needs to match an constant environment variable set up in symfony2 (e.g. aC9Uu5JR9zvZi99e). All requests with invalid access token should throw an error (401). (Not Yet)
-
Using HTTP-Requests (PUT, GET, POST, DELETE), users should be able to list, get, create, store and delete passwords using curl (example curl requests below) (Done)
-
Passwords should be stored in a database (MySQL). Only one table required ('passwords') (Done)
-
All requests and responses should use the JSON format. (Done)
- Write unit tests for all five request types using PHPUnit (https://symfony.com/doc/current/book/testing.html).
- If you prefer TDD (Test driven development), feel free to start with "Task 2A: Unit Tests" before/along with "Task 1: Basic Functionality". (Done) command : phpunit -c app
- Write a simple AngularJS Client that communicates with the server. The user interface should fulfill all REST features (create password, edit password, list of passwords, show password details, delete a password). ( http://localhost:8000/api/v1/passwords )
The following operations / api-endpoints should be implemented
curl -X POST -H "Content-Type: application/json" -d '{"key":"google", "username": "info@gmail.com", "password": "asdfasdf"}' "http://localhost:8000/api/v1/passwords"
curl -X PUT -H "Content-Type: application/json" -d '{"username": "info@gmail.com", "password": "asdfasdf"}' "http://localhost:8000/api/v1/passwords/google.json"
curl -X GET -H "Content-Type: application/json" "http://localhost:8000/api/v1/passwords.json"
curl -X GET -H "Content-Type: application/json" "http://localhost:8000/api/v1/passwords/google.json"
curl -X DELETE -H "Content-Type: application/json" "http://localhost:8000/api/v1/passwords/google.json"