Skip to content

[INS-398] Added tests to ensure that custom endpoint configuration works in artifactory detectors#4832

Open
MuneebUllahKhan222 wants to merge 4 commits intotrufflesecurity:mainfrom
MuneebUllahKhan222:artifactory-custom-ep
Open

[INS-398] Added tests to ensure that custom endpoint configuration works in artifactory detectors#4832
MuneebUllahKhan222 wants to merge 4 commits intotrufflesecurity:mainfrom
MuneebUllahKhan222:artifactory-custom-ep

Conversation

@MuneebUllahKhan222
Copy link
Copy Markdown
Contributor

@MuneebUllahKhan222 MuneebUllahKhan222 commented Mar 24, 2026

Description

This PR adds test coverage for both Artifactory detectors by introducing:

  • 1 unit test
  • 1 integration test

for each detector.

The tests explicitly configure detector endpoints using s.SetConfiguredEndpoints to ensure that:

  • Detected secrets are validated against the intended configured endpoint

Purpose

  • Improves confidence in detector behavior
  • Ensures that the custom endpoint configuration works as expected in artifactory detectors.

Checklist:

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

Note

Low Risk
Low risk because changes are limited to new unit/integration tests validating endpoint configuration behavior; no production detector logic is modified.

Overview
Adds new unit and integration tests for artifactory and artifactoryreferencetoken detectors that explicitly set endpoints via SetConfiguredEndpoints and assert the configured endpoint is included in Scanner.Endpoints() and in emitted Result.RawV2.

Integration tests run FromData with verification enabled and validate the detector uses the configured endpoint when forming the secret+endpoint pairing (including trimming https:// for reference tokens).

Written by Cursor Bugbot for commit 89069ae. This will update automatically on new commits. Configure here.

@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team March 24, 2026 09:53
@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team as a code owner March 24, 2026 09:53
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

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.

1 participant