mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
add implementation for no master key set and fix tests
This commit is contained in:
parent
1cf6efa740
commit
f0ecacb58d
3 changed files with 53 additions and 29 deletions
|
@ -173,13 +173,28 @@ impl AuthController {
|
|||
pub struct AuthFilter {
|
||||
pub search_rules: SearchRules,
|
||||
pub allow_index_creation: bool,
|
||||
master_key_missing: bool,
|
||||
}
|
||||
|
||||
impl AuthFilter {
|
||||
pub fn with_no_master_key() -> AuthFilter {
|
||||
AuthFilter {
|
||||
search_rules: SearchRules::default(),
|
||||
allow_index_creation: true,
|
||||
master_key_missing: true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_missing_master_key(&self) -> bool {
|
||||
self.master_key_missing
|
||||
}
|
||||
}
|
||||
impl Default for AuthFilter {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
search_rules: SearchRules::default(),
|
||||
allow_index_creation: true,
|
||||
master_key_missing: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue