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
No known key found for this signature in database
GPG key ID: 0406DF6C3A69B942
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<()> {
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_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 uid = Uuid::new_v4();
Self {
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,
actions: vec![Action::AllGet, Action::KeysGet],
actions: vec![Action::AllGet, Action::KeysGedt],
indexes: vec![IndexUidPattern::all()],
expires_at: None,
created_at: now,