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

Silvermob: host validation (us, eu, apac) #3110

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

freemmy
Copy link
Contributor

@freemmy freemmy commented Sep 15, 2023

Second level domains are being validated before usage. Allowed only eu.silvermob.com, us.silvermob.com and apac.silvermob.com

@github-actions
Copy link

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, a52cec6

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:21:	isValidHost		100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:34:	Builder			100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:46:	GetHeaders		91.7%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:69:	MakeRequests		91.3%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:119:	getImpressionExt	85.7%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:135:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:146:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:197:	getMediaTypeForImp	100.0%
total:									(statements)		95.0%

@hhhjort hhhjort changed the title host validation (us, eu, apac) Silvermob: host validation (us, eu, apac) Sep 18, 2023
@@ -121,8 +133,14 @@ func (a *SilverMobAdapter) getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.Ext
}

func (a *SilverMobAdapter) buildEndpointURL(params *openrtb_ext.ExtSilverMob) (string, error) {
endpointParams := macros.EndpointTemplateParams{ZoneID: params.ZoneID, Host: params.Host}
return macros.ResolveMacros(a.endpoint, endpointParams)
if isValidHost(params.Host) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please be mindful that your adapter has been flagged as it is currently using dynamic hosts. Please refer to the github issue here - #2612

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's why we added this validation. Is it enough?

Copy link
Contributor

Choose a reason for hiding this comment

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

You should strive to render the host non-dynamic by excluding the host parameter from the domain and use it as a query parameter instead. The domain name should remain constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, we will select a vendor for geo DNS and publish update within a couple of weeks

Copy link
Contributor

Choose a reason for hiding this comment

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

@freemmy Please advise if you would like to make changes for geo DNS in this PR or a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thing the next PR since it takes some time

@github-actions
Copy link

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, 0ffb7cc

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:21:	isValidHost		100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:26:	Builder			100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:38:	GetHeaders		91.7%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:61:	MakeRequests		91.3%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:111:	getImpressionExt	85.7%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:127:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:138:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/silvermob/silvermob.go:189:	getMediaTypeForImp	100.0%
total:									(statements)		94.9%

@gargcreation1992 gargcreation1992 merged commit a91e40c into prebid:master Sep 26, 2023
5 checks passed
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