Skip to content

fix: authenticate pipeline URL fetches to the git server only - #1737

Draft
Skisocks wants to merge 2 commits into
jenkins-x:mainfrom
spring-financial-group:fix/RawURLSourceAuth
Draft

Skisocks wants to merge 2 commits into
jenkins-x:mainfrom
spring-financial-group:fix/RawURLSourceAuth

Conversation

@Skisocks

@Skisocks Skisocks commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Changelog

  • Pipeline files referenced by full URL (uses:https://…, or a URL in a trigger's source:) are now fetched with FileBrowsers.GetURL. Previously load_triggers.go built its own HTTP client and read GIT_SERVER, GIT_USER and GIT_TOKEN from the environment.
  • Add filebrowser.WithServerAuth, which sends basic auth only to the git server (same scheme and host, port included) and resolves the token on each request.
  • A redirect off the git server drops the token.

Context

Follow-up to #1734. Removes the last direct GIT_TOKEN read outside scmclients.

Exported WithServerAuth so jx-pipeline can pass it when it builds its own FileBrowsers.

Behaviour Changes

Previously the token was only sent when the URL's hostname equals GIT_SERVER. jx sets GIT_SERVER to a full URL (https://github.com by default), so it never matches (req.URL.Hostname() = github.com) therefore all requests go out unauthenticated. With this change they authenticate to the git server's scheme and host.

@jenkins-x-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
The changes made require 1 more approval(s).
To complete the pull request process, please assign skisocks
You can assign the PR to them by writing /assign @skisocks in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants