rewrite comment

adminDb
remrem 3 years ago
parent ebc3013b4a
commit 6fb11652fb

@ -1,6 +1,7 @@
import 'package:shelf/shelf.dart'; import 'package:shelf/shelf.dart';
import 'package:shelf_router/shelf_router.dart'; import 'package:shelf_router/shelf_router.dart';
// Class for all static function that handles api routes
class API { class API {
/*---------------| /*---------------|
|-------GET------| |-------GET------|
@ -11,9 +12,7 @@ class API {
return Response.ok('Greetings from PassWorld!\n'); return Response.ok('Greetings from PassWorld!\n');
} }
// Request for authentification // Check for authentication
// Compare given cyphered_hash_password with db cyphered_hash_password
// Return boolean -> true (hash match) false (no match)
static Response authenticator(Request req) { static Response authenticator(Request req) {
final mail = req.params['mail']; final mail = req.params['mail'];
final password = req.params['cyphered_password_hash']; final password = req.params['cyphered_password_hash'];
@ -21,9 +20,7 @@ class API {
return Response.ok('true'); return Response.ok('true');
} }
// Request sqlite password db // Download sqlite password file
// Check auth
// Return sqlite file
static Response downloadPasswordDb(Request req) { static Response downloadPasswordDb(Request req) {
final mail = req.params['mail']; final mail = req.params['mail'];
final password = req.params['cyphered_password_hash']; final password = req.params['cyphered_password_hash'];
@ -47,6 +44,7 @@ class API {
|------POST------| |------POST------|
|---------------*/ |---------------*/
// Create account
static Response createAccount(Request req) { static Response createAccount(Request req) {
return Response.ok(""); return Response.ok("");
} }
@ -55,14 +53,17 @@ class API {
|-------PUT------| |-------PUT------|
|---------------*/ |---------------*/
// Update master password
static Response changeMasterPassword(Request req) { static Response changeMasterPassword(Request req) {
return Response.ok("master password chnaged"); return Response.ok("master password chnaged");
} }
// Update mail
static Response changeMail(Request req) { static Response changeMail(Request req) {
return Response.ok("master password chnaged"); return Response.ok("master password chnaged");
} }
// Upload sqlite password file
static Response uploadPasswordDb(Request req) { static Response uploadPasswordDb(Request req) {
return Response.ok(""); return Response.ok("");
} }
@ -71,6 +72,7 @@ class API {
|-----DELETE-----| |-----DELETE-----|
|---------------*/ |---------------*/
// Delete account
static Response deleteAccount(Request req) { static Response deleteAccount(Request req) {
return Response.ok(""); return Response.ok("");
} }

Loading…
Cancel
Save