mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 07:36:53 +00:00
5bdbd66d09
* feat(targets): support Kafka SASL auth * fix(targets): infer Kafka SASL when enable is blank --------- Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
66 lines
2.7 KiB
Rust
66 lines
2.7 KiB
Rust
// Copyright 2024 RustFS Team
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// Kafka Environment Variables
|
|
pub const ENV_AUDIT_KAFKA_ENABLE: &str = "RUSTFS_AUDIT_KAFKA_ENABLE";
|
|
pub const ENV_AUDIT_KAFKA_BROKERS: &str = "RUSTFS_AUDIT_KAFKA_BROKERS";
|
|
pub const ENV_AUDIT_KAFKA_TOPIC: &str = "RUSTFS_AUDIT_KAFKA_TOPIC";
|
|
pub const ENV_AUDIT_KAFKA_ACKS: &str = "RUSTFS_AUDIT_KAFKA_ACKS";
|
|
pub const ENV_AUDIT_KAFKA_TLS_ENABLE: &str = "RUSTFS_AUDIT_KAFKA_TLS_ENABLE";
|
|
pub const ENV_AUDIT_KAFKA_TLS_CA: &str = "RUSTFS_AUDIT_KAFKA_TLS_CA";
|
|
pub const ENV_AUDIT_KAFKA_TLS_CLIENT_CERT: &str = "RUSTFS_AUDIT_KAFKA_TLS_CLIENT_CERT";
|
|
pub const ENV_AUDIT_KAFKA_TLS_CLIENT_KEY: &str = "RUSTFS_AUDIT_KAFKA_TLS_CLIENT_KEY";
|
|
pub const ENV_AUDIT_KAFKA_SASL_ENABLE: &str = "RUSTFS_AUDIT_KAFKA_SASL_ENABLE";
|
|
pub const ENV_AUDIT_KAFKA_SASL_MECHANISM: &str = "RUSTFS_AUDIT_KAFKA_SASL_MECHANISM";
|
|
pub const ENV_AUDIT_KAFKA_SASL_USERNAME: &str = "RUSTFS_AUDIT_KAFKA_SASL_USERNAME";
|
|
pub const ENV_AUDIT_KAFKA_SASL_PASSWORD: &str = "RUSTFS_AUDIT_KAFKA_SASL_PASSWORD";
|
|
pub const ENV_AUDIT_KAFKA_QUEUE_DIR: &str = "RUSTFS_AUDIT_KAFKA_QUEUE_DIR";
|
|
pub const ENV_AUDIT_KAFKA_QUEUE_LIMIT: &str = "RUSTFS_AUDIT_KAFKA_QUEUE_LIMIT";
|
|
|
|
pub const ENV_AUDIT_KAFKA_KEYS: &[&str; 14] = &[
|
|
ENV_AUDIT_KAFKA_ENABLE,
|
|
ENV_AUDIT_KAFKA_BROKERS,
|
|
ENV_AUDIT_KAFKA_TOPIC,
|
|
ENV_AUDIT_KAFKA_ACKS,
|
|
ENV_AUDIT_KAFKA_TLS_ENABLE,
|
|
ENV_AUDIT_KAFKA_TLS_CA,
|
|
ENV_AUDIT_KAFKA_TLS_CLIENT_CERT,
|
|
ENV_AUDIT_KAFKA_TLS_CLIENT_KEY,
|
|
ENV_AUDIT_KAFKA_SASL_ENABLE,
|
|
ENV_AUDIT_KAFKA_SASL_MECHANISM,
|
|
ENV_AUDIT_KAFKA_SASL_USERNAME,
|
|
ENV_AUDIT_KAFKA_SASL_PASSWORD,
|
|
ENV_AUDIT_KAFKA_QUEUE_DIR,
|
|
ENV_AUDIT_KAFKA_QUEUE_LIMIT,
|
|
];
|
|
|
|
/// A list of all valid configuration keys for a Kafka audit target.
|
|
pub const AUDIT_KAFKA_KEYS: &[&str] = &[
|
|
crate::ENABLE_KEY,
|
|
crate::KAFKA_BROKERS,
|
|
crate::KAFKA_TOPIC,
|
|
crate::KAFKA_ACKS,
|
|
crate::KAFKA_TLS_ENABLE,
|
|
crate::KAFKA_TLS_CA,
|
|
crate::KAFKA_TLS_CLIENT_CERT,
|
|
crate::KAFKA_TLS_CLIENT_KEY,
|
|
crate::KAFKA_SASL_ENABLE,
|
|
crate::KAFKA_SASL_MECHANISM,
|
|
crate::KAFKA_SASL_USERNAME,
|
|
crate::KAFKA_SASL_PASSWORD,
|
|
crate::KAFKA_QUEUE_DIR,
|
|
crate::KAFKA_QUEUE_LIMIT,
|
|
crate::COMMENT_KEY,
|
|
];
|