-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into synchronize-maven-dependencies
# Conflicts: # extra/bundle/pom.xml # extra/pom.xml
- Loading branch information
Showing
86 changed files
with
3,335 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Publish Docker image for new tag/release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
name: Publish Docker image for new tag/release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
matrix: | ||
java: [ 17 ] | ||
dockerfile-path: [Dockerfile, extra/Dockerfile] | ||
include: | ||
- dockerfile-path: Dockerfile | ||
build-cmd: mvn clean package -Dcheckstyle.skip -Dmaven.test.skip=true | ||
package-name: ghcr.io/${{ github.repository }} | ||
- dockerfile-path: extra/Dockerfile | ||
build-cmd: mvn clean package --file extra/pom.xml -Dcheckstyle.skip -Dmaven.test.skip=true | ||
package-name: ghcr.io/${{ github.repository }}-bundle | ||
steps: | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
java-version: ${{ matrix.java }} | ||
- name: Build .jar via Maven | ||
run: ${{ matrix.build-cmd }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker Image | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ matrix.package-name }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ${{ matrix.dockerfile-path }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Module functional tests | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.github/**' | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java: [ 17 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Build with Maven | ||
run: mvn package -DskipUnitTests=true --file extra/pom.xml | ||
|
||
- name: Run module tests | ||
run: mvn -B verify -DskipUnitTests=true -DskipFunctionalTests=true -Dtests.max-container-count=5 -DdockerfileName=Dockerfile-modules --file extra/pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Publish release .jar | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Publish release .jar | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 17 ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Build base .jar via Maven | ||
run: mvn clean package -Dcheckstyle.skip -Dmaven.test.skip=true | ||
- name: Upload and attach base .jar to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/prebid-server.jar | ||
asset_name: prebid-server-${{ github.ref_name }}.jar | ||
tag: ${{ github.ref }} | ||
|
||
- name: Build bundled .jar via Maven | ||
run: mvn clean package --file extra/pom.xml -Dcheckstyle.skip -Dmaven.test.skip=true | ||
- name: Upload and attach bundled .jar to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: extra/bundle/target/prebid-server-bundle.jar | ||
asset_name: prebid-server-bundle-${{ github.ref_name }}.jar | ||
overwrite: true | ||
tag: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM amazoncorretto:17 | ||
|
||
WORKDIR /app/prebid-server | ||
|
||
VOLUME /app/prebid-server/conf | ||
VOLUME /app/prebid-server/data | ||
|
||
COPY src/main/docker/run.sh ./ | ||
COPY src/main/docker/application.yaml ./ | ||
COPY target/prebid-server-bundle.jar ./prebid-server.jar | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8060 | ||
|
||
ENTRYPOINT [ "/app/prebid-server/run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Overview | ||
|
||
This module filters out bids from all the bid responses by the provided filtering logic for any given auction. | ||
The filtering logic can be provided by enabling the hook. | ||
|
||
## Configuration | ||
|
||
To start using current module you have to enable module and add ``pb-richmedia-filter-all-processed-bid-responses-hook`` into hooks execution plan inside your yaml file: | ||
```yaml | ||
hooks: | ||
pb-richmedia-filter: | ||
enabled: true | ||
host-execution-plan: > | ||
{ | ||
"endpoints": { | ||
"/openrtb2/auction": { | ||
"stages": { | ||
"all-processed-bid-responses": { | ||
"groups": [ | ||
{ | ||
"timeout": 100, | ||
"hook-sequence": [ | ||
{ | ||
"module-code": "pb-richmedia-filter", | ||
"hook-impl-code": "pb-richmedia-filter-all-processed-bid-responses-hook" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
And configure | ||
## List of module configuration options | ||
- `filter-mraid` - `true` enables the following logic: filter out any bid response that contains the provided `mraid-script-pattern` in the `adm` field | ||
- `mraid-script-pattern` - a raw string with the MRAID script to be searched as it is | ||
|
||
```yaml | ||
hooks: | ||
modules: | ||
pb-richmedia-filter: | ||
filter-mraid: true | ||
mraid-script-pattern: > | ||
<script src="mraid.js"></script> | ||
``` | ||
|
||
## Maintainer contacts | ||
|
||
Any suggestions or questions can be directed by opening a new [issue](https://github.com/prebid/prebid-server-java/issues/new) | ||
or [pull request](https://github.com/prebid/prebid-server-java/pulls) in this repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.prebid.server.hooks.modules</groupId> | ||
<artifactId>all-modules</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>pb-richmedia-filter</artifactId> | ||
|
||
<name>pb-richmedia-filter</name> | ||
<description>Richmedia Filter</description> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config.stopBubbling = true | ||
lombok.anyConstructor.suppressConstructorProperties = false |
38 changes: 38 additions & 0 deletions
38
...server/hooks/modules/pb/richmedia/filter/config/PbRichmediaFilterModuleConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.prebid.server.hooks.modules.pb.richmedia.filter.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.prebid.server.hooks.modules.pb.richmedia.filter.core.BidResponsesMraidFilter; | ||
import org.prebid.server.hooks.modules.pb.richmedia.filter.core.ModuleConfigResolver; | ||
import org.prebid.server.hooks.modules.pb.richmedia.filter.model.PbRichMediaFilterProperties; | ||
import org.prebid.server.hooks.modules.pb.richmedia.filter.v1.PbRichmediaFilterAllProcessedBidResponsesHook; | ||
import org.prebid.server.hooks.modules.pb.richmedia.filter.v1.PbRichmediaFilterModule; | ||
import org.prebid.server.json.ObjectMapperProvider; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.List; | ||
|
||
@ConditionalOnProperty(prefix = "hooks." + PbRichmediaFilterModule.CODE, name = "enabled", havingValue = "true") | ||
@Configuration | ||
public class PbRichmediaFilterModuleConfiguration { | ||
|
||
@Bean | ||
PbRichmediaFilterModule pbRichmediaFilterModule( | ||
@Value("${hooks.modules.pb-richmedia-filter.filter-mraid}") Boolean filterMraid, | ||
@Value("${hooks.modules.pb-richmedia-filter.mraid-script-pattern}") String mraidScriptPattern) { | ||
|
||
final ObjectMapper mapper = ObjectMapperProvider.mapper(); | ||
final PbRichMediaFilterProperties globalProperties = PbRichMediaFilterProperties.of( | ||
filterMraid, | ||
mraidScriptPattern); | ||
|
||
return new PbRichmediaFilterModule(List.of( | ||
new PbRichmediaFilterAllProcessedBidResponsesHook( | ||
mapper, | ||
new BidResponsesMraidFilter(), | ||
new ModuleConfigResolver(mapper, globalProperties)))); | ||
} | ||
|
||
} |
Oops, something went wrong.