Skip to content

SuperEdge: add new adapter - #4846

Open
LeeZXin wants to merge 8 commits into
prebid:masterfrom
LeeZXin:dev
Open

SuperEdge: add new adapter#4846
LeeZXin wants to merge 8 commits into
prebid:masterfrom
LeeZXin:dev

Conversation

@LeeZXin

@LeeZXin LeeZXin commented Jul 3, 2026

Copy link
Copy Markdown

New Adapter: SuperEdge

SuperEdge is a DSP/SSP provided by SuperEdge Inc.

Supported Media Types

  • Banner
  • Native

Bidder Parameters

Parameter Type Required Description
sk string yes Publisher key issued by SuperEdge

Endpoint

https://rtb-us.superedge.co.jp/bid?sk={{.sk}}

Test Parameters

{
  "sk": "your-sk-here"
}

Contact

Comment thread adapters/superedge/superedge.go Outdated
default:
for _, imp := range imps {
if imp.ID == bid.ImpID {
if imp.Banner != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeBanner, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.

Comment thread adapters/superedge/superedge.go Outdated
if imp.Banner != nil {
return openrtb_ext.BidTypeBanner, nil
}
if imp.Native != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeNative, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.

@LeeZXin

LeeZXin commented Jul 13, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek @jney @minaguib @dlackty @asweeney86 Please help review the code and merge it. Thanks

@github-actions

Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c4d5bd4

superedge

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:23:	Builder		100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:32:	MakeRequests	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:44:	makeRequest	86.7%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:72:	getSuperEdgeExt	94.1%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:107:	getEndPoint	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:111:	preProcess	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:125:	MakeBids	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:154:	getBidType	100.0%
total:									(statements)	96.2%

@LeeZXin

LeeZXin commented Jul 15, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek @jney @minaguib @dlackty @asweeney86 Please help review the code and merge it. Thanks

Comment thread static/bidder-info/superedge.yaml Outdated
Comment on lines +1 to +11
endpoint: "https://rtb-us.superedge.co.jp/bid?sk={{.sk}}"
endpointCompression: gzip
geoscope:
- USA
maintainer:
email: op@superedge.co.jp
capabilities:
site:
mediaTypes:
- banner
- native

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.

where is glvId ?

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.

gvlVendorID*

@github-actions

Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 7e467a2

superedge

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:23:	Builder		100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:32:	MakeRequests	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:44:	makeRequest	86.7%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:72:	getSuperEdgeExt	94.1%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:107:	getEndPoint	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:111:	preProcess	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:125:	MakeBids	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:154:	getBidType	100.0%
total:									(statements)	96.2%

geoscope:
- USA
maintainer:
email: op@superedge.co.jp

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.

waiting for response

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.

Image

Comment thread static/bidder-info/superedge.yaml Outdated
@@ -0,0 +1,11 @@
endpoint: "https://rtb-us.superedge.co.jp/bid?sk={{.sk}}"

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.

works

Image

@@ -0,0 +1,122 @@
{

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.

please add multi imps example

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I will handle the issues with glvid and multi-imp as soon as possible.

"page": "https://www.example.com/"
}
},
"httpcalls": [

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.

NIP: httpCalls

banner.W = &firstFormat.W
banner.H = &firstFormat.H
request.Imp[i].Banner = &banner
}

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.

This line mutates the caller's original BidRequest — it overwrites the
Banner pointer on the request object owned by PBS core. PBS adapters must
not modify the incoming request (copy-on-write rule). After MakeRequests
returns, downstream PBS code (logging, floors, other adapters) will see the
modified Banner.W/Banner.H values.

Fix: make a shallow copy of the request and its Imp slice before calling
preProcess:

func (a *adapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestData, error) {
    ...
    requestCopy := *request
    requestCopy.Imp = make([]openrtb2.Imp, len(request.Imp))
    copy(requestCopy.Imp, request.Imp)
    preProcess(&requestCopy)
    reqBody, err := jsonutil.Marshal(&requestCopy)
    ...
}

"$schema": "http://json-schema.org/draft-04/schema#",
"title": "SuperEdge Adapter Params",
"description": "A schema which validates params accepted by the SuperEdge adapter",
"type": "object",

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.

Missing "additionalProperties": false. Without it the schema accepts objects
with arbitrary unknown fields, e.g. {"sk": "abc", "foo": "bar"} passes
validation. All other PBS adapter schemas include this constraint.

@LeeZXin

LeeZXin commented Jul 16, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek All issues you mentioned — copy-on-write mutation, bid-type anti-pattern, multi-imp tests, httpCalls casing, additionalProperties, and gvlVendorID — have been addressed. Please take another look, thanks.

@github-actions

Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 02b2019

superedge

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:23:	Builder		100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:32:	MakeRequests	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:44:	makeRequest	94.4%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:75:	getSuperEdgeExt	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:110:	getEndPoint	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:114:	preProcess	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:128:	MakeBids	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:157:	getBidType	100.0%
total:									(statements)	98.8%

- USA
maintainer:
email: op@superedge.co.jp
gvlVendorID: 1554

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.

verifed:

Image

przemkaczmarek
przemkaczmarek previously approved these changes Jul 16, 2026
@LeeZXin

LeeZXin commented Jul 16, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek Thanks for the approval! It looks like we still need one more review to merge — could you help get another reviewer?

@LeeZXin

LeeZXin commented Jul 20, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek Thanks for the approval!
@bsardo Sorry for the direct ping — would you mind taking a look at this PR as well? Thanks!

@LeeZXin

LeeZXin commented Jul 22, 2026

Copy link
Copy Markdown
Author

@ChrisHuie @Taxel @postindustria-code Sorry for the ping — would any of you be available to review this PR? Much appreciated!

@postindustria-code

Copy link
Copy Markdown
Contributor

Docs PR required (before merge). I don't see a link to a prebid.github.io
documentation PR in the description — could you add it?

Per the Prebid Server bidder guide:

Human readable documentation for bid adapters is required in the separate
prebid.github.io repository. We will not merge your bid adapter until you've
at least opened a documentation PR and comment with a link to it.

"required": [
"sk"
],
"additionalProperties": false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Schema additionalProperties:false contradicts the exemplary fixturesstatic/bidder-params/superedge.json:16 allows only sk, but exemplary imp.ext.bidder blocks send region + placementId (e.g. sample-banner-apac.json:15-21, sample-banner-euc.json:15-22, sample-banner.json, sample-nobid.json, sample-banner-fallback-*.json). Self-contradicting within the PR: params_test.go:47-48 explicitly asserts {"region":"APAC"} / {"region":"US"} are invalid.
    • Mechanism (proven, not inferred). Ran the real PBS validator (openrtb_ext.NewBidderParamsValidatorValidate, the same one params_test.go uses) against the exact fixture shape:
      • {"sk":"abc"} → ACCEPTED
      • {"sk":"abc","region":"APAC"}REJECTED: Additional property region is not allowed
      • {"sk":"abc","region":"APAC","placementId":"p1"}REJECTED: region + placementId not allowed
        This closes the gap in the naive reading — {"region":"APAC"} in invalidParams fails on both missing-sk and additionalProperties, but a valid sk plus the extra keys is still rejected purely by additionalProperties:false.
    • Impact is a hard 400, stronger than "imp dropped". ortb/request_validator.go:133-135: on a params validation error it return []error{fmt.Errorf("request.imp[%d].ext.prebid.bidder.%s failed validation…")} — the whole bid request is rejected (400), gated only by the host's cfg.SkipBidderParams (default false = validation ON). A publisher copying the exemplary imp.ext.bidder shape gets the auction rejected, not a silent partial drop.

Fix: remove region/placementId from all exemplary imp.ext.bidder blocks (the adapter reads neither) — or, if they are real params, add them to the schema + ExtSuperEdge + validParams and drop them from invalidParams. Option A matches the current schema/yaml.

if err := jsonutil.Unmarshal(response.Body, &bidResp); err != nil {
return nil, []error{err}
}
bidResponse := adapters.NewBidderResponseWithBidsCapacity(1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Response currency dropped — builds NewBidderResponseWithBidsCapacity(1) (which defaults Currency: "USD", adapters/bidder.go:75) and never reads bidResp.Cur. Latent: every exemplary uses cur: "USD" / currency: "USD", so no test exposes it — the mislabel only surfaces if the endpoint returns a non-USD cur. Fix: if bidResp.Cur != "" { bidResponse.Currency = bidResp.Cur }.

"Please avoid common mistakes, such as not specifying the bid currency and not properly detecting the media type from the bidding server response."https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html

Comment on lines +110 to +112
func (a *adapter) getEndPoint(ext *openrtb_ext.ExtSuperEdge) (string, error) {
return macros.ResolveMacros(a.EndpointTemplate, map[string]string{"sk": ext.Sk})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

region / apac-euc-use fixtures are non-functional & misleadinggetEndPoint resolves only sk; all 8 exemplaries emit the identical rtb-us... URI (confirmed). region is in no struct/schema and routes nothing. Drop it and rename/merge the fixtures, or (if geo routing is intended) implement region→host mapping.

Comment on lines +44 to +50
var invalidParams = []string{
`{}`,
`{"tn": "0c3356713c184ca186779eecdd5aff5d"}`,
`{"region": "APAC"}`,
`{"region": "US"}`,
`{"tn": "27bb74d57068406ebcbb29ab9bfeb9b9"}`,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

params_test.go missing type-mismatch / minLength casesinvalidParams covers missing-sk + unknown-field, but not {"sk":123} (type) or {"sk":""} (minLength:1). Two-line add.

"Please include tests for required fields, optional fields, conditional fields such as oneOf, regex filters, and data type mismatches."https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html

Comment thread adapters/superedge/superedge.go Outdated
Comment on lines +78 to +88
// Try to get sk from request.ext.prebid.bidderparams first
if request.Ext != nil {
reqExt := &openrtb_ext.ExtRequest{}
if err := jsonutil.Unmarshal(request.Ext, reqExt); err == nil {
if len(reqExt.Prebid.BidderParams) > 0 {
if err := jsonutil.Unmarshal(reqExt.Prebid.BidderParams, &extSuperEdge); err == nil && extSuperEdge.Sk != "" {
return &extSuperEdge, nil
}
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Redundant request-level sk extraction + dead guard — because sk is schema-required on imp.ext.bidder, the imp path always resolves it, so the request.ext.prebid.bidderparams primary path (superedge.go:78-88) is never necessary: it only adds a per-request request.Ext unmarshal on the hot path and a surprising precedence (request-level sk silently overrides the per-imp value). The if extSuperEdge.Sk != "" guard at superedge.go:104 is dead given the schema. Consider reading sk from imp[0].ext.bidder only. (Not a blocker.)

@@ -0,0 +1,104 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixtures that don't test what their names implysample-banner-fallback-to-first-imp-to-get-ep.json has no request.ext and a single imp with sk, so it uses the plain imp path — the same path as the other banner fixtures; it doesn't uniquely exercise the fallback-selection branch (which needs ext.prebid.bidderparams present-but-without-sk). bad_request_no_token.json sends imp.ext.bidder={placementId} (no sk) and asserts superEdge sk not found, but in prod such an imp is rejected by schema validation (required sk + additionalProperties:false) before the adapter runs, so that branch is unreachable in production (tied to the redundant-check item above).

Comment thread adapters/superedge/superedge.go Outdated
headers := http.Header{}
headers.Add("Content-Type", "application/json;charset=utf-8")
headers.Add("Accept", "application/json")
headers.Add("x-openrtb-version", "2.5")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

x-openrtb-version: 2.5 header vs bid.MType (a 2.6 field) usage — set the header to 2.6

@LeeZXin

LeeZXin commented Jul 22, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek @postindustria-code all review comments have been addressed — removed redundant sk extraction, fixed response currency and x-openrtb-version header, added region-based multi-endpoint routing (US/EU/APAC), updated test fixtures and schema.
Docs PR opened at prebid/prebid.github.io#6672.
Please take another look when you have a moment, thanks!

@github-actions

Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 07e4523

superedge

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:24:	Builder		100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:33:	MakeRequests	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:45:	makeRequest	94.4%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:76:	getSuperEdgeExt	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:98:	getEndPoint	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:106:	getRegionHost	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:117:	preProcess	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:131:	MakeBids	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:163:	getBidType	100.0%
total:									(statements)	98.8%

@postindustria-code

Copy link
Copy Markdown
Contributor

@LeeZXin, approved. Do not forget upgrade your branch "This branch is out-of-date with the base branch"

@LeeZXin

LeeZXin commented Jul 23, 2026

Copy link
Copy Markdown
Author

@LeeZXin, approved. Do not forget upgrade your branch "This branch is out-of-date with the base branch"

@postindustria-code Thanks for the approval, and thanks for the heads-up on the branch!

@github-actions

Copy link
Copy Markdown

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, c5aed73

superedge

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:24:	Builder		100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:33:	MakeRequests	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:45:	makeRequest	94.4%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:76:	getSuperEdgeExt	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:98:	getEndPoint	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:106:	getRegionHost	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:117:	preProcess	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:131:	MakeBids	100.0%
github.com/prebid/prebid-server/v4/adapters/superedge/superedge.go:163:	getBidType	100.0%
total:									(statements)	98.8%

@LeeZXin

LeeZXin commented Jul 27, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek friendly reminder — the approval was dismissed due to the latest commit. Would appreciate a re-review when you get a chance. Thanks!

@LeeZXin

LeeZXin commented Jul 28, 2026

Copy link
Copy Markdown
Author

@bsardo could you take a look when you have a moment? we're just waiting on one more review. Happy to address any feedback. Thanks!

@LeeZXin

LeeZXin commented Jul 31, 2026

Copy link
Copy Markdown
Author

@przemkaczmarek Thanks for approval!!

@LeeZXin

LeeZXin commented Jul 31, 2026

Copy link
Copy Markdown
Author

@bsardo both approvals are in, could you take a final look or merge when you have a moment? Thanks!

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