Échange de données 1

Échange de données 1


4.3- Exercices

Laboratoire 3

Programmer les fonctionnalités client et serveur d'un gestionnaire d'URL raccourcies accessible via HTTP.

Linky

Serveur

http
Liste
GET /links
Authorization: Basic ...

===

200
Content-Type: application/json

[
{ "url": ..., "hash": ... }
...
]

~~~ Authentification invalide

401
WWW-Authenticate: Basic
http
Ajout
POST /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: Basic
http
Modification
PATCH /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: Basic
http
Suppression
DELETE /links/...HASH...
Authorization: Basic ...

===

204

~~~

404
Content-Type: text/plain

Link not found

~~~ Authentification invalide

401
WWW-Authenticate: Basic
http
Navigation
GET /l/...HASH...

===

302
Location: ...URL...

~~~

404
Content-Type: text/plain

Link not found

Client

Utiliser ce client en ligne de commande comme point de départ.

Authentification
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
Liste
~~~~~~ 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...
Ajout
~~~~~~ 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...
Modification
~~~~~~ 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...
Suppression
~~~~~~ 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...
Quitter
~~~~~~ LINKY ~~~~~~
l: List a: Add e: Edit d: Delete q: Quit
>> q

Remise

Énoncé de travail LÉA

Échange de données 1

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