feat(x2a): git auth credentials#2839
Conversation
The e62d73d added a way to use auth url, but when the token has any illegal character for the URL, it fails to se the auth URL. This change get the Auth Token, set the username (by backstage) and the token and it uses credentials helper for setting the commit. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
|
Code Review by Qodo
1. Helper script injection
|
Review Summary by QodoUse git credential helper for authenticated repository access
WalkthroughsDescription• Replace URL-based auth with credential helper approach • Support tokens with special characters that break URL format • Use Backstage-provided "username:password" token format • Extract username and password from token for git credential helper Diagramflowchart LR
A["Token with special chars"] -->|Previous: URL injection| B["URL parsing fails"]
A -->|New: Credential helper| C["Parse username:password"]
C -->|Extract parts| D["Set git credentials"]
D -->|Supports| E["GitHub/GitLab/Bitbucket"]
File Changes1. workspaces/x2a/plugins/x2a-backend/templates/x2a-job-script.sh
|



The e62d73d added a way to use auth url, but when the token has any illegal character for the URL, it fails to se the auth URL.
This change get the Auth Token, set the username (by backstage) and the token and it uses credentials helper for setting the commit.