Programmer les fonctionnalités client et serveur d'un gestionnaire d'URL raccourcies accessible via HTTP.
/l/... qui permet de naviguer vers une URLGET /links
Authorization: Basic ...
===
200
Content-Type: application/json
[
{ "url": ..., "hash": ... }
...
]
~~~ Authentification invalide
401
WWW-Authenticate: BasicPOST /links
Authorization: Basic ...
Content-Type: application/json | text/plain
{ "url": ... } | ...url...
===
201
Content-Type: application/json
{ "url": ..., "hash": ... }
~~~
400
Content-Type: text/plain
...Error Message...
~~~ Authentification invalide
401
WWW-Authenticate: BasicPATCH /links/...HASH...
Authorization: Basic ...
Content-Type: application/json | text/plain
{ "url": ... } | ...URL...
===
200
Content-Type: application/json
{ "url": ..., "hash": ... }
~~~
404
Content-Type: text/plain
Link not found
~~~
400
Content-Type: text/plain
...Error Message...
~~~ Authentification invalide
401
WWW-Authenticate: BasicDELETE /links/...HASH...
Authorization: Basic ...
===
204
~~~
404
Content-Type: text/plain
Link not found
~~~ Authentification invalide
401
WWW-Authenticate: BasicGET /l/...HASH...
===
302
Location: ...URL...
~~~
404
Content-Type: text/plain
Link not foundUtiliser ce client en ligne de commande comme point de départ.
Username: abcde
Password: wrong
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> l
~~~~~~ LINKY ~~~~~~
Invalid credentials
Press a key to quit...
Username: alice
Password: pwda~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> l
~~~~~~ LINKY ~~~~~~
http://localhost:4567/l/AYk95N
↪ http://shawinigan.info
http://localhost:4567/l/4mxExA
↪ http://cshaw.jhoffman.ca
Press a key to continue...~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> a
~~~~~~ LINKY ~~~~~~
URL: patate
Invalid URL, host unreachable
Press a key to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> a
~~~~~~ LINKY ~~~~~~
URL: http://perdu.com
New link added: http://localhost:4567/l/oWF6HP
Press a key to continue...~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> e
~~~~~~ LINKY ~~~~~~
Hash: patate
URL: http://perdu.com
Link not found
Press a key to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> e
~~~~~~ LINKY ~~~~~~
Hash: a3Xrth
URL: http://perdu.com
Link updated
http://localhost:4567/l/a3Xrth
↪ http://perdu.com
Press a key to continue...~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> l
~~~~~~ LINKY ~~~~~~
http://localhost:4567/l/AYk95N
↪ http://shawinigan.info
http://localhost:4567/l/4mxExA
↪ http://cshaw.jhoffman.ca
http://localhost:4567/l/oWF6HP
↪ http://perdu.com
Press a key to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> d
~~~~~~ LINKY ~~~~~~
Hash: patate
Link not found
Press a key to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> d
~~~~~~ LINKY ~~~~~~
Hash: AYk95N
Press a key to continue...~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> qÉnoncé de travail LÉA
Nom:
| Qualité de rédaction, ZIP, Nomenclature, Formatage | 0 -0.5 -1 -2 |
| Qualité de l'implémentation, syntaxe, mécanismes, réutilisation | 0 -0.5 -1 -2 |
| Serveur | |
| Intégration du module d'authentification fourni | 0 -1 -2 |
| GET /links, auth === status, headers, body, fichier | 3 2.5 2 1 0 |
| POST /links, auth, headers, body === status, headers, body, validations, fichier | 3 2.5 2 1 0 |
| PATCH /links/...HASH..., auth, headers, body === status, headers, body, validations, fichier | 3 2.5 2 1 0 |
| DELETE /links/...HASH..., auth === status, headers, body, validations, fichier | 3 2.5 2 1 0 |
| GET /l/...HASH... === status, headers, body, validations, fichier | 3 2.5 2 1 0 |
| Client | |
| Authentification | 1 0.5 0 |
| Liste, requête, réponse, affichage | 2 1.5 1 0 |
| Ajout, requête, réponse, affichage | 2 1.5 1 0 |
| Modification, requête, réponse, affichage | 2 1.5 1 0 |
| Modification/Ajout, Format du body json ou texte | 2 1.5 1 0 |
| Suppression, requête, réponse, affichage | 2 1.5 1 0 |
| Intégration au client fourni, UI/UX cohérent | 0 -0.5 -1 -2 |