Skip to content

Conversation

@randreucetti
Copy link

Fixes #24718

Changes

  • Replace overly broad substring check contains("version") with specific endpoint check
  • Now only skips auth for /system/version endpoint, not all URLs containing "version"
  • Add comprehensive unit tests

Problem

The authentication provider was skipping auth headers for any URL containing "version" as a substring, including:

  • Entity names like "data-conversion-service" (contains "version" in "conversion")
  • Entity names like "dataset-version-tracker"

Solution

Changed the check from:

if (requestTemplate.url().contains("version")) {
  return;
}

To:

String url = requestTemplate.url();
if (url.endsWith("/system/version") || url.contains("/system/version?")) {
  return;
}

This ensures only the actual version endpoint skips authentication, not every URL with "version" in it.

Testing

Added unit tests that verify:

  • Auth headers ARE added for entities with "conversion", "version", etc. in their names
  • Auth headers are NOT added for the /system/version endpoint
  • Auth headers are NOT added for /system/version?param=value

Replace overly broad substring check that was skipping auth headers
for any URL containing 'version' (including entity names like
'data-conversion-service'). Now only skips auth for the specific
/system/version endpoint.

Fixes open-metadata#24718
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

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.

Bug: 401 "Token not present" for entity names containing "version" substring

1 participant