mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
add TAGS_ARE_SENSITIVE env variable
This commit is contained in:
@@ -654,6 +654,12 @@ pub async fn get_logs_from_store(
|
||||
return None;
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref TAGS_ARE_SENSITIVE: bool = std::env::var("TAGS_ARE_SENSITIVE").map(
|
||||
|v| v.parse().unwrap()
|
||||
).unwrap_or(false);
|
||||
}
|
||||
|
||||
pub async fn check_tag_available_for_workspace_internal(
|
||||
db: &DB,
|
||||
w_id: &str,
|
||||
@@ -691,10 +697,14 @@ pub async fn check_tag_available_for_workspace_internal(
|
||||
)));
|
||||
}
|
||||
|
||||
return Err(error::Error::BadRequest(format!(
|
||||
if *TAGS_ARE_SENSITIVE {
|
||||
return Err(Error::BadRequest(format!("{tag} is not available to you")));
|
||||
} else {
|
||||
return Err(error::Error::BadRequest(format!(
|
||||
"Only super admins are allowed to use tags that are not included in the allowed CUSTOM_TAGS: {:?}",
|
||||
custom_tags_per_w
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user