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

chore: simplify test tempdir #9152

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

crenshaw-dev
Copy link
Member

@crenshaw-dev crenshaw-dev commented Apr 20, 2022

Follow-up to simplify this test: #8508 (comment)

I also added a test to make sure we hit this error:

	if !strings.HasPrefix(certPath, dataPath) {
		return nil, fmt.Errorf("could not get certificate for host %s", serverName)
	}

In other words, check for a directory traversal.

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
@crenshaw-dev crenshaw-dev requested a review from jannfis April 20, 2022 14:10
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #9152 (29bb39e) into master (d2f5060) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #9152      +/-   ##
==========================================
- Coverage   45.52%   45.48%   -0.05%     
==========================================
  Files         219      219              
  Lines       25882    25882              
==========================================
- Hits        11783    11772      -11     
- Misses      12458    12472      +14     
+ Partials     1641     1638       -3     
Impacted Files Coverage Δ
applicationset/services/scm_provider/github.go 63.52% <0.00%> (-17.65%) ⬇️
applicationset/services/scm_provider/utils.go 88.50% <0.00%> (+4.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2f5060...29bb39e. Read the comment docs.

Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@crenshaw-dev crenshaw-dev enabled auto-merge (squash) April 20, 2022 14:34
@crenshaw-dev crenshaw-dev merged commit 248929c into argoproj:master Apr 20, 2022
wojtekidd pushed a commit to wojtekidd/argo-cd that referenced this pull request Apr 25, 2022
* chore: simplify test tempdir

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>

* test: add test for traversal

Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
Signed-off-by: wojtekidd <wojtek.cichon@protonmail.com>
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.

4 participants