Programmer un gestionnaire d'URL raccourcies accessible via HTTP. Utiliser ce client en ligne de commande comme point de départ.
/l/...
qui permet de naviguer vers une URLGET /links HTTP/1.1
Authorization: Basic ...
===
200
Content-Type: application/json
[
{ "url": ..., "hash": ... }
...
]
~~~ Authentification invalide
401
Content-Type: text/plain
WWW-Authenticate: Basic
POST /links HTTP/1.1
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
Content-Type: text/plain
WWW-Authenticate: Basic
PATCH /links/...HASH... HTTP/1.1
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
Content-Type: text/plain
WWW-Authenticate: Basic
DELETE /links/...HASH... HTTP/1.1
Authorization: Basic ...
===
204
Content-Type: text/plain
~~~
404
Content-Type: text/plain
Link not found
~~~ Authentification invalide
401
Content-Type: text/plain
WWW-Authenticate: Basic
GET /l/...HASH... HTTP/1.1
===
307
Content-Type: text/plain
Location: ...URL...
~~~
404
Content-Type: text/plain
Link not found
Pour toutes les requêtes qui demandent une authentification, l'application demande les identifiants s'ils n'ont pas été fournis ou invalides.
Username: abcde
Password: wrong
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> l
~~~~~~ LINKY ~~~~~~
Invalid credentials
Press Enter to continue...
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 Enter to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> a
~~~~~~ LINKY ~~~~~~
URL: patate
Invalid URL, host unreachable
Press Enter 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 Enter 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 Enter 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 Enter 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 Enter to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> d
~~~~~~ LINKY ~~~~~~
Hash: patate
Link not found
Press Enter to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> d
~~~~~~ LINKY ~~~~~~
Hash: AYk95N
Press Enter to continue...
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> q
18 novembre, 8h AM via 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 | 2 1.5 1 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 |