mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 11:06:17 +00:00
feat(targets): enhance webhook TLS support with custom CA and skip-verify (#1994)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: houseme <4829346+houseme@users.noreply.github.com> Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -20,9 +20,11 @@ pub const ENV_AUDIT_WEBHOOK_QUEUE_LIMIT: &str = "RUSTFS_AUDIT_WEBHOOK_QUEUE_LIMI
|
||||
pub const ENV_AUDIT_WEBHOOK_QUEUE_DIR: &str = "RUSTFS_AUDIT_WEBHOOK_QUEUE_DIR";
|
||||
pub const ENV_AUDIT_WEBHOOK_CLIENT_CERT: &str = "RUSTFS_AUDIT_WEBHOOK_CLIENT_CERT";
|
||||
pub const ENV_AUDIT_WEBHOOK_CLIENT_KEY: &str = "RUSTFS_AUDIT_WEBHOOK_CLIENT_KEY";
|
||||
pub const ENV_AUDIT_WEBHOOK_CLIENT_CA: &str = "RUSTFS_AUDIT_WEBHOOK_CLIENT_CA";
|
||||
pub const ENV_AUDIT_WEBHOOK_SKIP_TLS_VERIFY: &str = "RUSTFS_AUDIT_WEBHOOK_SKIP_TLS_VERIFY";
|
||||
|
||||
/// List of all environment variable keys for a webhook target.
|
||||
pub const ENV_AUDIT_WEBHOOK_KEYS: &[&str; 7] = &[
|
||||
pub const ENV_AUDIT_WEBHOOK_KEYS: &[&str; 9] = &[
|
||||
ENV_AUDIT_WEBHOOK_ENABLE,
|
||||
ENV_AUDIT_WEBHOOK_ENDPOINT,
|
||||
ENV_AUDIT_WEBHOOK_AUTH_TOKEN,
|
||||
@@ -30,6 +32,8 @@ pub const ENV_AUDIT_WEBHOOK_KEYS: &[&str; 7] = &[
|
||||
ENV_AUDIT_WEBHOOK_QUEUE_DIR,
|
||||
ENV_AUDIT_WEBHOOK_CLIENT_CERT,
|
||||
ENV_AUDIT_WEBHOOK_CLIENT_KEY,
|
||||
ENV_AUDIT_WEBHOOK_CLIENT_CA,
|
||||
ENV_AUDIT_WEBHOOK_SKIP_TLS_VERIFY,
|
||||
];
|
||||
|
||||
/// A list of all valid configuration keys for a webhook target.
|
||||
@@ -42,4 +46,6 @@ pub const AUDIT_WEBHOOK_KEYS: &[&str] = &[
|
||||
crate::WEBHOOK_CLIENT_CERT,
|
||||
crate::WEBHOOK_CLIENT_KEY,
|
||||
crate::COMMENT_KEY,
|
||||
crate::WEBHOOK_CLIENT_CA,
|
||||
crate::WEBHOOK_SKIP_TLS_VERIFY,
|
||||
];
|
||||
|
||||
@@ -20,6 +20,8 @@ pub const EVENT_DEFAULT_DIR: &str = "/opt/rustfs/events"; // Default directory f
|
||||
pub const AUDIT_DEFAULT_DIR: &str = "/opt/rustfs/audit"; // Default directory for audit store
|
||||
pub const DEFAULT_LIMIT: u64 = 100000; // Default store limit
|
||||
|
||||
pub const RUSTFS_WEBHOOK_SKIP_TLS_VERIFY_DEFAULT: bool = false;
|
||||
|
||||
/// Standard config keys and values.
|
||||
pub const ENABLE_KEY: &str = "enable";
|
||||
pub const COMMENT_KEY: &str = "comment";
|
||||
|
||||
@@ -16,6 +16,8 @@ pub const WEBHOOK_ENDPOINT: &str = "endpoint";
|
||||
pub const WEBHOOK_AUTH_TOKEN: &str = "auth_token";
|
||||
pub const WEBHOOK_CLIENT_CERT: &str = "client_cert";
|
||||
pub const WEBHOOK_CLIENT_KEY: &str = "client_key";
|
||||
pub const WEBHOOK_CLIENT_CA: &str = "client_ca";
|
||||
pub const WEBHOOK_SKIP_TLS_VERIFY: &str = "skip_tls_verify";
|
||||
pub const WEBHOOK_BATCH_SIZE: &str = "batch_size";
|
||||
pub const WEBHOOK_QUEUE_LIMIT: &str = "queue_limit";
|
||||
pub const WEBHOOK_QUEUE_DIR: &str = "queue_dir";
|
||||
|
||||
@@ -22,6 +22,8 @@ pub const NOTIFY_WEBHOOK_KEYS: &[&str] = &[
|
||||
crate::WEBHOOK_CLIENT_CERT,
|
||||
crate::WEBHOOK_CLIENT_KEY,
|
||||
crate::COMMENT_KEY,
|
||||
crate::WEBHOOK_CLIENT_CA,
|
||||
crate::WEBHOOK_SKIP_TLS_VERIFY,
|
||||
];
|
||||
|
||||
// Webhook Environment Variables
|
||||
@@ -32,8 +34,10 @@ pub const ENV_NOTIFY_WEBHOOK_QUEUE_LIMIT: &str = "RUSTFS_NOTIFY_WEBHOOK_QUEUE_LI
|
||||
pub const ENV_NOTIFY_WEBHOOK_QUEUE_DIR: &str = "RUSTFS_NOTIFY_WEBHOOK_QUEUE_DIR";
|
||||
pub const ENV_NOTIFY_WEBHOOK_CLIENT_CERT: &str = "RUSTFS_NOTIFY_WEBHOOK_CLIENT_CERT";
|
||||
pub const ENV_NOTIFY_WEBHOOK_CLIENT_KEY: &str = "RUSTFS_NOTIFY_WEBHOOK_CLIENT_KEY";
|
||||
pub const ENV_NOTIFY_WEBHOOK_CLIENT_CA: &str = "RUSTFS_NOTIFY_WEBHOOK_CLIENT_CA";
|
||||
pub const ENV_NOTIFY_WEBHOOK_SKIP_TLS_VERIFY: &str = "RUSTFS_NOTIFY_WEBHOOK_SKIP_TLS_VERIFY";
|
||||
|
||||
pub const ENV_NOTIFY_WEBHOOK_KEYS: &[&str; 7] = &[
|
||||
pub const ENV_NOTIFY_WEBHOOK_KEYS: &[&str; 9] = &[
|
||||
ENV_NOTIFY_WEBHOOK_ENABLE,
|
||||
ENV_NOTIFY_WEBHOOK_ENDPOINT,
|
||||
ENV_NOTIFY_WEBHOOK_AUTH_TOKEN,
|
||||
@@ -41,4 +45,6 @@ pub const ENV_NOTIFY_WEBHOOK_KEYS: &[&str; 7] = &[
|
||||
ENV_NOTIFY_WEBHOOK_QUEUE_DIR,
|
||||
ENV_NOTIFY_WEBHOOK_CLIENT_CERT,
|
||||
ENV_NOTIFY_WEBHOOK_CLIENT_KEY,
|
||||
ENV_NOTIFY_WEBHOOK_CLIENT_CA,
|
||||
ENV_NOTIFY_WEBHOOK_SKIP_TLS_VERIFY,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user