Impl a credentials store #8

Closed
opened 2022-09-21 10:14:00 +02:00 by rmanach · 2 comments
rmanach commented 2022-09-21 10:14:00 +02:00 (Migrated from gitea.thegux.fr)

In order to validate the credentials send by the request, the HTTPResponse must validate the data with the one stored in the store. This store must be an interface in order to be upgraded in the future.

Impl example:

pub trait Store {
	pub is_auth(name: &str, password: &str) -> bool;
}

pub struct FileStore {
	path: String
}

impl Store for FileStore {
	...
}
In order to validate the credentials send by the request, the `HTTPResponse` must validate the data with the one stored in the `store`. This `store` must be an **interface** in order to be upgraded in the future. Impl example: ```rust pub trait Store { pub is_auth(name: &str, password: &str) -> bool; } pub struct FileStore { path: String } impl Store for FileStore { ... } ```
rmanach commented 2022-09-21 10:17:04 +02:00 (Migrated from gitea.thegux.fr)

To open the file set in FileStore use : https://docs.rs/tokio/latest/tokio/fs/struct.File.html

To open the file set in `FileStore` use : https://docs.rs/tokio/latest/tokio/fs/struct.File.html
rmanach commented 2022-10-04 10:19:05 +02:00 (Migrated from gitea.thegux.fr)

merged on develop 8049763b18

merged on develop https://gitea.thegux.fr/rmanach/simple-auth/commit/8049763b1845d7bced0c0d612ea05d436498ebad
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rmanach/simple-auth#8
No description provided.