Skip to content

Fix tests - #6

Merged
lionello merged 5 commits into
DefangLabs:mainfrom
n-peugnet:fix-tests
Nov 15, 2026
Merged

lionello merged 5 commits into
DefangLabs:mainfrom
n-peugnet:fix-tests

Conversation

@n-peugnet

Copy link
Copy Markdown

As said in #5 here are the fixes for the tests. See each commit comment for an explanation.

The tested feature has been disabled in 9c679ce
but the tests were left as is, and thus were failing.
Flatten implementation was changed in fbb2a33,
but the tests were not updated. The new behaviour is expected as seen in the
tests for flatten itself.
HTTP auth has been updated in cc17356
to include base64 validation, the test of this package have been
updated but not the global one.
We are now using values that are expected to be detected also in the
global tests.
Since e4d27d8 (in a change that does
not match the commit name), the private keys detected are returned
completely instead of juste the first line.
So the global tests had to be updated.
This reverts commit 73888f5.

This commit breaks all the TestSingleValue that contain an URL. This is
because the IniTransformer parses a colon as a key-value delimiter.
Prior to this commit the result of the INI parser were always ignored if
it consisted of a single key-value pair, and I think it is better this
way.

I don't really understand the point in trying to parse ini files beofre
looking for secrets in them anyway.

@defangdevs defangdevs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified locally: with this branch checked out, go build ./... and go test ./... are fully green (main currently has 5 failing tests without this). Reviewed each commit against the referenced regressions — the fixes track them accurately, e.g. the ini_transformer revert restores pre-regression behavior (reject any single key/value parse, since base64 strings ending in == were being misparsed) exactly as the commit message explains. The two disabled artifactory "password" cases are correctly commented out (not deleted) since that detection was intentionally disabled upstream. Confirmed this merges cleanly together with #4 and #5 with no conflicts and everything still green combined.

@defangdevs

Copy link
Copy Markdown

This PR fixes the CI failure currently on main (https://github.com/DefangLabs/secret-detector/actions/runs/35139530653), introduced by #5 adding the build workflow — the password/artifactory tests were stale after that detection path was disabled.

Verified locally: merging current main into this branch is conflict-free, and go test ./... passes cleanly afterward.

@lionello could you review/merge this to get main green?

@defangdevs

Copy link
Copy Markdown

Bumping this: PR #8 (external contributor, unrelated bytesize-formatting change) just hit the same red CI and had to be told it's not their fault. This is now blocking review of legitimate outside contributions, not just tidying up main. @lionello, merging this whenever you get a chance would unblock things.

@n-peugnet

Copy link
Copy Markdown
Author

@lionello any update about this? And also about tagging a release, even a pre-release would do.

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.

3 participants