fossas / fossa-cli

Fast, portable and reliable dependency analysis for any codebase. Supports license & vulnerability scanning for large monoliths. Language-agnostic; integrates with 20+ build systems.
https://fossa.com
Other
1.26k stars 173 forks source link

[ANE-1861] strip auth from git projects cloned via url #1451

Closed jagonalez closed 1 month ago

jagonalez commented 1 month ago

Overview

This PR wont affect current locators as core already strips auth when generating a custom locator, however the CLI will send a locator of custom+{orgId}/username@bitbucket.org/owner/repo for all other endpoints. This was only happening to projects cloned from a bitbucket url with a username.

Changes:

Acceptance criteria

Testing plan

Here's the debug logs for the urls:

// ssh url
{
  "projectName": "git@bitbucket.org:jeremygonzalez/test.git",
  "projectRevision": "51f90e00d46d273b5cacb4ff3a7a75170bd14c95",
  "projectBranch": "main"
}
// https://user@bitbucket.org/jeremygonzalez/test.git
{
  "projectName": "https://bitbucket.org/jeremygonzalez/test.git",
  "projectRevision": "51f90e00d46d273b5cacb4ff3a7a75170bd14c95",
  "projectBranch": "main"
}

Risks

Minimal risks, we're already stripping the auth part in core when creating the locator.

Metrics

Is this change something that can or should be tracked? If so, can we do it today? And how? If its easy, do it

References

See https://fossa.atlassian.net/browse/ANE-1864 for more info

Checklist