mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
first mostly working version
This commit is contained in:
parent
6fae317277
commit
cac924b663
18 changed files with 403 additions and 57 deletions
|
@ -165,6 +165,17 @@ impl AuthController {
|
|||
None => Ok(false),
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete all the keys in the DB.
|
||||
pub fn raw_delete_all_keys(&mut self) -> Result<()> {
|
||||
self.store.delete_all_keys()
|
||||
}
|
||||
|
||||
/// Delete all the keys in the DB.
|
||||
pub fn raw_insert_key(&mut self, key: Key) -> Result<()> {
|
||||
self.store.put_api_key(key)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthFilter {
|
||||
|
|
|
@ -197,6 +197,13 @@ impl HeedAuthStore {
|
|||
Ok(existing)
|
||||
}
|
||||
|
||||
pub fn delete_all_keys(&self) -> Result<()> {
|
||||
let mut wtxn = self.env.write_txn()?;
|
||||
self.keys.clear(&mut wtxn)?;
|
||||
wtxn.commit()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn list_api_keys(&self) -> Result<Vec<Key>> {
|
||||
let mut list = Vec::new();
|
||||
let rtxn = self.env.read_txn()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue