ryerraguntla commented on code in PR #4043:
URL: https://github.com/apache/iggy/pull/4043#discussion_r4001609397


##########
gateways/kafka/src/bridge/config.rs:
##########
@@ -0,0 +1,287 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.
+
+use std::path::Path;
+
+use secrecy::SecretString;
+use tracing::warn;
+
+use crate::bridge::error::BridgeError;
+use crate::bridge::topic_map::{TopicMapping, validate_identifier_name};
+
+const DEFAULT_IGGY_ADDR: &str = "127.0.0.1:8090";
+/// Matches `DEFAULT_ROOT_USERNAME` (`core/server/src/boot/credentials.rs`) - 
the root user's
+/// username is always `iggy` regardless of how its password was provisioned, 
so defaulting this
+/// one field is safe. The password is a different story - see why there is no
+/// `DEFAULT_IGGY_PASSWORD` at [`IggyBridgeConfig::from_env`].
+const DEFAULT_IGGY_USERNAME: &str = "iggy";
+
+/// Connection + topic-mapping config for 
[`IggyBridge`](crate::bridge::iggy_bridge::IggyBridge).
+///
+/// `Debug` is safe to derive: `password` is `SecretString`, which redacts on 
`Debug` by design
+/// (`secrecy` crate) - never add a plain `String` credential field here 
without the same
+/// treatment (see `connector-pr-review` blocker B1 in the connectors 
subsystem for why).
+#[derive(Debug, Clone)]
+pub struct IggyBridgeConfig {
+    pub address: String,
+    pub username: String,
+    pub password: SecretString,
+    pub topic_mapping: TopicMapping,
+}
+
+impl IggyBridgeConfig {
+    /// The complete set of `IGGY_KAFKA_*` vars this module reads. Mirrors 
`main.rs`'s
+    /// `KNOWN_KAFKA_ENV_VARS` guard - add new vars to both, or a typo 
silently no-ops instead of

Review Comment:
   **Fixed** - corrected the comment to describe the actual (and correct) 
design in main.rs: two independently-checked lists, not one list two places 
need to stay in sync on.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to