Skip to content

reworked matching logic#208

Merged
raphael-goetz merged 1 commit intomainfrom
#207-manual-url-verfication
Apr 19, 2026
Merged

reworked matching logic#208
raphael-goetz merged 1 commit intomainfrom
#207-manual-url-verfication

Conversation

@raphael-goetz
Copy link
Copy Markdown
Member

Resolves: #207

Copilot AI review requested due to automatic review settings April 19, 2026 17:52
@github-actions
Copy link
Copy Markdown

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/draco/-/pipelines/2463762238

Status: Passed
Duration: 1 minutes

Job summaries

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/13989243933/artifacts/out/index.html

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reworks REST adapter flow identification to prevent accidental URL matches by anchoring the configured URL regex and improving observability around route matching (resolving #207).

Changes:

  • Refactors RequestRoute::identify to use a helper for extracting string flow settings and adds structured debug logs for rejection reasons.
  • Introduces matches_route_pattern to anchor the route regex (^...$) to avoid substring matches.
  • Adds unit tests for the anchored matching helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adapter/rest/src/route.rs
Comment thread adapter/rest/src/route.rs
Comment thread adapter/rest/src/route.rs
Comment on lines +55 to +70
let route_pattern = format!("/{}{}", flow.project_slug, flow_http_url);
log::debug!(
"Comparing regex {} with literal route: {}",
regex_str,
"route identify route check: flow_id={} httpURL={:?} resolved_pattern={:?} request_path={:?}",
flow.flow_id,
flow_http_url,
route_pattern,
self.url
);

// Check if the request is matching
match regex::Regex::new(regex_str) {
Ok(regex) => {
log::debug!("Successfully compiled regex: {}", regex_str);
regex.is_match(&self.url)
}
Err(err) => {
log::error!("Failed to compile regex: {}", err);
false
}
}
let is_match = matches_route_pattern(&route_pattern, &self.url);
log::debug!(
"route identify result: flow_id={} matched={}",
flow.flow_id,
is_match
);
is_match
@raphael-goetz raphael-goetz merged commit 53ac3b0 into main Apr 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual URL verification after regex comparission

2 participants