Skip to content

Floxis: validate bid impression against outbound request - #4676

Open
floxis-admin wants to merge 3 commits into
prebid:masterfrom
floxis-admin:codex/java-floxis-impid
Open

floxis-admin wants to merge 3 commits into
prebid:masterfrom
floxis-admin:codex/java-floxis-impid

Conversation

@floxis-admin

@floxis-admin floxis-admin commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Type of change

  • Bugfix
  • Bid adapter update

Context

Floxis splits requests by seat and routing host. Bid parsing looked impressions up in the original request rather than the outgoing request that produced the response, so a response could return a bid for another group's impression. A supplied mtype also skipped the impression lookup entirely.

Change

Each response bid's impid is checked against the outgoing request's impressions (httpCall.getRequest().getPayload().getImp()) before its media type is resolved, including when mtype is set. Bids that fail the check return the existing bad_server_response error and are skipped; other bids in the same response are kept.

Only the Floxis adapter and its unit tests change.

Test plan

  • FloxisBidderTest (28 tests) and checkstyle pass.
  • makeBidsShouldReturnErrorWhenBidImpIdIsNotInOutgoingRequest covers a bid for an impression that is in the original request but not in the outgoing one, with mtype set. It fails against the current master adapter.

Comment on lines +558 to +572
@Test
public void makeBidsShouldReturnErrorWhenBidImpIdNotFoundAndMTypePresent() throws Exception {
// given
final BidRequest bidRequest = givenBidRequest(identity());
final BidResponse bidResponse = givenBidResponse(Bid.builder().impid("no-such-imp").mtype(1).build());
final BidderCall<BidRequest> httpCall = givenHttpCall(bidRequest, mapper.writeValueAsString(bidResponse));

// when
final Result<List<BidderBid>> result = target.makeBids(httpCall, bidRequest);

// then
assertThat(result.getValue()).isEmpty();
assertThat(result.getErrors()).containsExactly(
BidderError.badServerResponse("unable to find impression no-such-imp for bid"));
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need for this test

Comment on lines +597 to +598
assertThat(result.getValue()).extracting(bidderBid -> bidderBid.getBid().getImpid())
.containsExactly("imp-1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

        assertThat(result.getValue())
                .extracting(BidderBid::getBid)
                .extracting(Bid::getImpid)
                .containsExactly("imp-1");

Comment on lines 539 to 556
@@ -555,6 +555,51 @@ public void makeBidsShouldReturnErrorWhenBidImpIdNotFound() throws Exception {
"unable to find impression no-such-imp for bid"));
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove old one test

@floxis-admin

Copy link
Copy Markdown
Contributor Author

@CTMBNara done in 527a79d: both impid-not-found tests are removed, and the remaining test uses the extracting(BidderBid::getBid).extracting(Bid::getImpid) chain. FloxisBidderTest and checkstyle pass.

@osulzhenko
osulzhenko requested a review from CTMBNara October 27, 2026 12:25
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