-
Notifications
You must be signed in to change notification settings - Fork 183
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
Greenbids fix geolookup: host and fetch GCS + mock dbReader UT #3626
base: master
Are you sure you want to change the base?
Conversation
e5faad5
to
ee640d3
Compare
...a/org/prebid/server/hooks/modules/greenbids/real/time/data/config/DatabaseReaderFactory.java
Outdated
Show resolved
Hide resolved
...a/org/prebid/server/hooks/modules/greenbids/real/time/data/config/DatabaseReaderFactory.java
Outdated
Show resolved
Hide resolved
...server/hooks/modules/greenbids/real/time/data/config/GreenbidsRealTimeDataConfiguration.java
Outdated
Show resolved
Hide resolved
...prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataService.java
Outdated
Show resolved
Hide resolved
Groovy IT is failing
I will push an empty commit to see if it is a flaky one |
private Path downloadFile(String url, String accountId, String licenseKey) throws IOException { | ||
final URL downloadUrl = new URL(url + "&account_id=" + accountId + "&license_key=" + licenseKey); | ||
final HttpURLConnection connection = (HttpURLConnection) downloadUrl.openConnection(); | ||
connection.setRequestMethod("GET"); | ||
|
||
final String auth = accountId + ":" + licenseKey; | ||
final String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes()); | ||
connection.setRequestProperty("Authorization", "Basic " + encodedAuth); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using vertx http client for file downloading
Also, it's a little bit weird that it's required to send credentials via the url and the authorization header simultaneously, I assume it should work both ways but separately, so I prefer using just URL approach and do not expose account id and license key as separate properties
🔧 Type of changes
✨ What's the context?
🧠 Rationale behind the change
GeoLite2-Country.mmdb
in Greenbids GCS bucket instead of open source URL: gs://greenbids-europe-west1-prebid-server-staging/GeoLite2-Country.mmdbgetCountry(ip)
only in case ifDevice::getGeo
is null (geoLookupEnabled is false in GeoLocationServiceWrapper)🔎 New Bid Adapter Checklist
🧪 Test plan
How do you know the changes are safe to ship to production?
🏎 Quality check