Improve key description

Co-authored-by: Tamo <tamo@meilisearch.com>
This commit is contained in:
Mubelotix
2025-06-27 09:39:24 +02:00
parent 2090e9ea31
commit c15763f910
2 changed files with 4 additions and 4 deletions

View File

@ -351,7 +351,7 @@ pub struct IndexSearchRules {
fn generate_default_keys(store: &HeedAuthStore) -> Result<()> { fn generate_default_keys(store: &HeedAuthStore) -> Result<()> {
store.put_api_key(Key::default_chat())?; store.put_api_key(Key::default_chat())?;
store.put_api_key(Key::default_management())?; store.put_api_key(Key::default_read_only_admin_key())?;
store.put_api_key(Key::default_admin())?; store.put_api_key(Key::default_admin())?;
store.put_api_key(Key::default_search())?; store.put_api_key(Key::default_search())?;

View File

@ -144,14 +144,14 @@ impl Key {
} }
} }
pub fn default_management() -> Self { pub fn default_read_only_admin_key() -> Self {
let now = OffsetDateTime::now_utc(); let now = OffsetDateTime::now_utc();
let uid = Uuid::new_v4(); let uid = Uuid::new_v4();
Self { Self {
name: Some("Default Read-Only Admin API Key".to_string()), name: Some("Default Read-Only Admin API Key".to_string()),
description: Some("Use it to peek into the instance in a read-only mode.".to_string()), description: Some("Use it to peek into the instance in a read-only mode. Caution: This key gives you access to all the other api keys. Do not expose it on a public frontend".to_string()),
uid, uid,
actions: vec![Action::AllGet, Action::KeysGet], actions: vec![Action::AllGet, Action::KeysGedt],
indexes: vec![IndexUidPattern::all()], indexes: vec![IndexUidPattern::all()],
expires_at: None, expires_at: None,
created_at: now, created_at: now,