Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode '%' when generating Git URLs #2214

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

rgmz
Copy link
Contributor

@rgmz rgmz commented Dec 14, 2023

Description:

This fixes an issue where file paths that contain % would cause UpdateLinkLineNumber to break.

Example:

2023-11-03T07:40:37-04:00       error   trufflehog      unable to parse link to update line number      {"detector_worker_id": "PSF2d", "timeout": 10, "link": "https://github.com/GeekMasher/tree-sitter-hcl/blob/a7f23cc5795769262f5515e52902f86c1b768994/example/real_world_stuff/coreos/coreos%tectonic-installer%installer%frontend%ui-tests%output%metal.tfvars#L1", "error": "parse \"https://github.com/GeekMasher/tree-sitter-hcl/blob/a7f23cc5795769262f5515e52902f86c1b768994/example/real_world_stuff/coreos/coreos%tectonic-installer%installer%frontend%ui-tests%output%metal.tfvars\": invalid URL escape \"%te\""}

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@rgmz rgmz requested a review from a team as a code owner December 14, 2023 14:53
@CLAassistant
Copy link

CLAassistant commented Dec 14, 2023

CLA assistant check
All committers have signed the CLA.

@rgmz rgmz force-pushed the fix/git-link-parse branch from 6a3f7c7 to 7e10a99 Compare December 14, 2023 14:54
Copy link
Collaborator

@ahrav ahrav left a comment

Choose a reason for hiding this comment

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

TIL, thanks.

@ahrav ahrav merged commit 22ae6a7 into trufflesecurity:main Dec 14, 2023
7 of 8 checks passed
@mcastorina
Copy link
Collaborator

Nice! I think this solution can be improved to cover all escapes via url.PathEscape.

@rgmz rgmz deleted the fix/git-link-parse branch December 14, 2023 17:28
@rgmz
Copy link
Contributor Author

rgmz commented Dec 14, 2023

Nice! I think this solution can be improved to cover all escapes via url.PathEscape.

That's a good point. I wasn't sure if additional escapes would break anything as I only encountered the issue with % specifically.

haraldh referenced this pull request in matter-labs/vault-auth-tee Dec 15, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog)
| action | patch | `v3.63.3` -> `v3.63.4` |

---

### Release Notes

<details>
<summary>trufflesecurity/trufflehog
(trufflesecurity/trufflehog)</summary>

###
[`v3.63.4`](https://github.com/trufflesecurity/trufflehog/releases/tag/v3.63.4)

[Compare
Source](https://github.com/trufflesecurity/trufflehog/compare/v3.63.3...v3.63.4)

#### What's Changed

- Bump github.com/docker/docker from 24.0.0+incompatible to
24.0.7+incompatible by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/trufflesecurity/trufflehog/pull/2213](https://github.com/trufflesecurity/trufflehog/pull/2213)
- Fix emoji in README by [@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2217](https://github.com/trufflesecurity/trufflehog/pull/2217)
- Upgrade sevenzip to v1.4.5 by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2215](https://github.com/trufflesecurity/trufflehog/pull/2215)
- Encode '%' when generating Git URLs by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2214](https://github.com/trufflesecurity/trufflehog/pull/2214)
- Fix GitParse trimming whitespace from filename by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2201](https://github.com/trufflesecurity/trufflehog/pull/2201)
- \[fixup] - Avoid reading decompressed data into memory by
[@&#8203;ahrav](https://github.com/ahrav) in
[https://github.com/trufflesecurity/trufflehog/pull/2196](https://github.com/trufflesecurity/trufflehog/pull/2196)
- Update GitLab v1 verification to check for valid JSON response by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2218](https://github.com/trufflesecurity/trufflehog/pull/2218)
- Check for SourceUnit support dynamically in the SourceManager by
[@&#8203;mcastorina](https://github.com/mcastorina) in
[https://github.com/trufflesecurity/trufflehog/pull/2205](https://github.com/trufflesecurity/trufflehog/pull/2205)
- Fix GitHub source showing 0 members by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2202](https://github.com/trufflesecurity/trufflehog/pull/2202)
- Don't run 'test' workflow in forks by
[@&#8203;rgmz](https://github.com/rgmz) in
[https://github.com/trufflesecurity/trufflehog/pull/2221](https://github.com/trufflesecurity/trufflehog/pull/2221)

**Full Changelog**:
trufflesecurity/trufflehog@v3.63.3...v3.63.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/matter-labs/vault-auth-tee).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuOTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants