Skip to content

Commit

Permalink
Fix bridge configuration for smartrest1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Rina Fujino <[email protected]>
  • Loading branch information
rina23q committed Oct 24, 2024
1 parent 59e9cd6 commit 0e71717
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/core/tedge/src/bridge/c8y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,17 @@ impl From<BridgeConfigC8yParams> for BridgeConfig {
.collect::<Vec<String>>();
topics.extend(templates_set);

// These topics are somehow required to receive operations when using Basic auth
let use_smartrest_one = use_basic_auth;
if use_smartrest_one {
// SmartRest1 (to support customers with existing solutions based on SmartRest 1)
// Only add the topics if at least 1 template is defined
if !smartrest_one_templates.0.is_empty() {
topics.extend([
format!(r#"s/ul/# out 2 {topic_prefix}/ """#),
format!(r#"t/ul/# out 2 {topic_prefix}/ """#),
format!(r#"q/ul/# out 2 {topic_prefix}/ """#),
format!(r#"c/ul/# out 2 {topic_prefix}/ """#),
format!(r#"s/dl/# in 2 {topic_prefix}/ """#),
]);
}

// SmartRest1 (to support customers with existing solutions based on SmartRest 1)
// Only add the topics if at least 1 template is defined
if !smartrest_one_templates.0.is_empty() {
let templates_set = smartrest_one_templates
.0
.iter()
Expand Down

0 comments on commit 0e71717

Please sign in to comment.