Skip to content

fix(rest): reject malformed authorization URLs#1336

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/rest-invalid-auth-url-config
Open

fix(rest): reject malformed authorization URLs#1336
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/rest-invalid-auth-url-config

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • reject malformed rest.authorization-url values instead of silently ignoring them
  • propagate auth URL parse failures from both initial catalog props and fetched REST config
  • add regression coverage for invalid local props and invalid server config

Why

fromProps previously swallowed url.Parse errors and left authUri unset. When OAuth credentials were later used, the client fell back to baseURI.JoinPath("oauth/tokens"), so a typo in rest.authorization-url could quietly send credentials to a different endpoint than intended.

Testing

  • go test ./catalog/rest -run 'Test(LoadRegisteredCatalogRejectsInvalidAuthURL|NewCatalogRejectsInvalidAuthURLFromConfig)$' -count=1
  • go test ./catalog/rest -count=1

@fallintoplace fallintoplace requested a review from zeroshade as a code owner June 27, 2026 17:00

@tanmayrauth tanmayrauth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean fix, the silent fallback to the default OAuth endpoint on a typo'd auth URL was a real credential-misrouting hazard

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.

2 participants