Skip to content

Commit 2e9d686

Browse files
committed
Updated args, apps and README
1 parent 932397c commit 2e9d686

File tree

6 files changed

+108
-66
lines changed

6 files changed

+108
-66
lines changed

Dockerfile

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,35 @@ COPY ./src ./src
1111
######################
1212
# Configure env vars #
1313
######################
14-
ENV UID2_E2E_ENV "github-test-pipeline"
15-
16-
ENV UID2_E2E_SITE_ID ""
17-
ENV UID2_E2E_API_KEY ""
18-
ENV UID2_E2E_API_SECRET ""
19-
ENV UID2_E2E_API_KEY_OLD ""
20-
ENV UID2_E2E_API_SECRET_OLD ""
21-
ENV UID2_E2E_API_KEY_SHARING_RECIPIENT ""
22-
ENV UID2_E2E_API_SECRET_SHARING_RECIPIENT ""
23-
ENV UID2_E2E_API_KEY_NON_SHARING_RECIPIENT ""
24-
ENV UID2_E2E_API_SECRET_NON_SHARING_RECIPIENT ""
25-
ENV UID2_E2E_SUBSCRIPTION_ID ""
26-
ENV UID2_E2E_SERVER_PUBLIC_KEY ""
27-
ENV UID2_E2E_ORIGIN ""
28-
ENV UID2_E2E_INVALID_ORIGIN ""
29-
30-
ENV UID2_E2E_IDENTITY_SCOPE ""
31-
ENV UID2_E2E_PHONE_SUPPORT ""
32-
33-
ENV UID2_E2E_PIPELINE_OPERATOR_URL ""
34-
ENV UID2_E2E_PIPELINE_OPERATOR_TYPE ""
35-
ENV UID2_E2E_PIPELINE_OPERATOR_CLOUD_PROVIDER ""
36-
37-
ENV UID2_E2E_CORE_API_TOKEN ""
38-
ENV UID2_E2E_OPTOUT_TO_CALL_CORE_API_TOKEN ""
39-
ENV UID2_E2E_CORE_URL ""
40-
ENV UID2_E2E_OPTOUT_URL ""
41-
42-
CMD \
43-
if [ "$UID2_E2E_PIPELINE_OPERATOR_TYPE" != "PUBLIC" ] && [ "$UID2_E2E_PIPELINE_OPERATOR_TYPE" != "PRIVATE" ] ; \
44-
then \
45-
echo "ERROR: Incorrect operator type: $UID2_E2E_PIPELINE_OPERATOR_TYPE. Exiting." ; \
46-
exit 1 ; \
47-
elif [ "$UID2_E2E_PIPELINE_OPERATOR_TYPE" = "PUBLIC" ] ; \
48-
then \
49-
mvn test -Dtest="E2EPublicOperatorTestSuite" ; \
50-
else \
51-
mvn test -Dtest="E2EPrivateOperatorTestSuite" ; \
52-
fi
14+
ENV E2E_SUITES ""
15+
ENV E2E_ARGS_JSON ""
16+
17+
ENV E2E_ENV ""
18+
ENV E2E_IDENTITY_SCOPE ""
19+
ENV E2E_PHONE_SUPPORT ""
20+
21+
ENV UID2_CORE_E2E_OPERATOR_API_KEY ""
22+
ENV UID2_CORE_E2E_OPTOUT_API_KEY ""
23+
ENV UID2_CORE_E2E_CORE_URL ""
24+
ENV UID2_CORE_E2E_OPTOUT_URL ""
25+
26+
ENV UID2_OPERATOR_E2E_CLIENT_SITE_ID ""
27+
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY ""
28+
ENV UID2_OPERATOR_E2E_CLIENT_API_SECRET ""
29+
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY_BEFORE_OPTOUT_CUTOFF ""
30+
ENV UID2_OPERATOR_E2E_CLIENT_API_SECRET_BEFORE_OPTOUT_CUTOFF ""
31+
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_RECIPIENT ""
32+
ENV UID2_OPERATOR_E2E_CLIENT_API_SECRET_SHARING_RECIPIENT ""
33+
ENV UID2_OPERATOR_E2E_CLIENT_API_KEY_NON_SHARING_RECIPIENT ""
34+
ENV UID2_OPERATOR_E2E_CLIENT_API_SECRET_NON_SHARING_RECIPIENT ""
35+
ENV UID2_OPERATOR_E2E_CSTG_SUBSCRIPTION_ID ""
36+
ENV UID2_OPERATOR_E2E_CSTG_SERVER_PUBLIC_KEY ""
37+
ENV UID2_OPERATOR_E2E_CSTG_ORIGIN ""
38+
ENV UID2_OPERATOR_E2E_CSTG_INVALID_ORIGIN ""
39+
40+
ENV UID2_PIPELINE_E2E_CORE_URL ""
41+
ENV UID2_PIPELINE_E2E_OPERATOR_URL ""
42+
ENV UID2_PIPELINE_E2E_OPERATOR_TYPE ""
43+
ENV UID2_PIPELINE_E2E_OPERATOR_CLOUD_PROVIDER ""
44+
45+
CMD mvn test -Dtest="${E2E_SUITES}"

README.md

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,68 @@ Any changes to [uid2-operator](https://github.com/IABTechLab/uid2-operator) need
88

99
There are different test suites that can be run depending on the environment and operator type:
1010

11-
| Test Suite | Description |
12-
|---------------------------------------|--------------------------------------------------------------|
13-
| `E2ELocalFullTestSuite` | Used when running both public and private operators locally. |
14-
| `E2EPipelinePrivateOperatorTestSuite` | Used when testing private operators in a pipeline. |
15-
| `E2EPipelinePublicOperatorTestSuite` | Used when testing public operators in a pipeline. |
16-
| `E2EPrivateOperatorTestSuite` | Used when testing real private operators. |
17-
| `E2EPublicOperatorTestSuite` | Used when testing real public operators. |
11+
| Test Suite | Description |
12+
|-------------------------------|-------------------------------------|
13+
| `E2ELocalFullTestSuite` | Used to test all apps locally |
14+
| `E2ECoreTestSuite` | Used when testing Core |
15+
| `E2EPublicOperatorTestSuite` | Used when testing public Operators |
16+
| `E2EPrivateOperatorTestSuite` | Used when testing private Operators |
17+
18+
## Environment Variables
19+
20+
* `E2E_SUITES` - **Docker image only** - The test suites to run, comma separated
21+
* e.g. `E2EPrivateOperatorTestSuite,E2ECoreTestSuite`
22+
* `E2E_ARGS_JSON` - The below environment variables can be put into this environment variable as a JSON
23+
* Any environment variables declared explicitly will override args in `E2E_ARGS_JSON`
24+
25+
### General
26+
27+
| Name | Value |
28+
|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
29+
| `E2E_ENV` | The E2E environment - this determines which apps get instantiated<br/>Certain tests run for `local` environments only<br/>Check `AppsMap` for details |
30+
| `E2E_IDENTITY_SCOPE` | The identity scope - one of [UID2, EUID] |
31+
| `E2E_PHONE_SUPPORT` | True if APIs support phone numbers, false otherwise |
32+
33+
### Core
34+
35+
| Name | Value |
36+
|----------------------------------|------------------------------------------------------|
37+
| `UID2_CORE_E2E_OPERATOR_API_KEY` | The API key for an Operator to communicate with Core |
38+
| `UID2_CORE_E2E_OPTOUT_API_KEY` | The API key for Optout to communicate with Core |
39+
| `UID2_CORE_E2E_CORE_URL` | The Core URL to include in attestation requests |
40+
| `UID2_CORE_E2E_OPTOUT_URL` | The Optout URL to include in attestation requests |
41+
42+
### Operator
43+
44+
| Name | Value |
45+
|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
46+
| `UID2_OPERATOR_E2E_CLIENT_SITE_ID` | The site ID of the client communicating with Operator |
47+
| `UID2_OPERATOR_E2E_CLIENT_API_KEY` | The API key for a client to communicate with Operator |
48+
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET` | The API secret for a client to communicate with Operator |
49+
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_BEFORE_OPTOUT_CUTOFF` | **Optout cutoff tests** - The API key before the optout policy cutoff for a client to communicate with Operator |
50+
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_BEFORE_OPTOUT_CUTOFF` | **Optout cutoff tests** - The API secret before the optout policy cutoff for a client to communicate with Operator |
51+
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_RECIPIENT` | **Sharing tests** - The API key with SHARER role for a client to communicate with Operator |
52+
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_SHARING_RECIPIENT` | **Sharing tests** - The API with SHARER role secret for a client to communicate with Operator |
53+
| `UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_NON_RECIPIENT` | **Sharing tests** - The API key without SHARER role for a client to communicate with Operator |
54+
| `UID2_OPERATOR_E2E_CLIENT_API_SECRET_NON_SHARING_RECIPIENT` | **Sharing tests** - The API without SHARER role secret for a client to communicate with Operator |
55+
| `UID2_OPERATOR_E2E_CSTG_SUBSCRIPTION_ID` | **CSTG tests** - The subscription ID |
56+
| `UID2_OPERATOR_E2E_CSTG_SERVER_PUBLIC_KEY` | **CSTG tests** - The server public key |
57+
| `UID2_OPERATOR_E2E_CSTG_ORIGIN` | **CSTG tests** - A valid origin |
58+
| `UID2_OPERATOR_E2E_CSTG_INVALID_ORIGIN` | **CSTG tests** - An invalid origin |
59+
60+
### Pipeline
61+
62+
| Name | Value |
63+
|---------------------------------------------|---------------------------------------------------------------------------------------------------------------|
64+
| `UID2_PIPELINE_E2E_CORE_URL` | The Core URL |
65+
| `UID2_PIPELINE_E2E_OPERATOR_URL` | The Operator URL |
66+
| `UID2_PIPELINE_E2E_OPERATOR_TYPE` | The type of Operator - one of [PUBLIC, PRIVATE] |
67+
| `UID2_PIPELINE_E2E_OPERATOR_CLOUD_PROVIDER` | Empty for public Operators, the cloud provider for private Operators - one of [aws-nitro, gcp-oidc, azure-cc] |
1868

1969
## Running the Dockerfile
2070

21-
`docker build -f Dockerfile -t uid2-e2e . && docker run --env <ENV>=<VAR> ... uid2-e2e`
22-
* Set each environment variable specified in the Dockerfile as `--env <ENV>=<VAR>`
71+
```shell
72+
docker build -f Dockerfile -t uid2-e2e .
73+
docker run --env <ENV>=<VAR> ... uid2-e2e
74+
```
2375
* If running the E2E tests against localhost, include the option `--network=host`

src/test/java/app/AppsMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
public final class AppsMap {
1111
private static final Map<String, String> APP_MAP;
12-
1312
private static final Apps APPS;
1413

1514
static {
@@ -22,6 +21,7 @@ public final class AppsMap {
2221
"uid2-prod", "app.Uid2ProdApps",
2322
"euid-integ", "app.EuidIntegApps",
2423
"euid-prod", "app.EuidProdApps",
24+
"github-test-pipeline-local", "app.GitHubTestPipelineApps",
2525
"github-test-pipeline", "app.GitHubTestPipelineApps"
2626
);
2727

src/test/java/common/Const.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
public final class Const {
44
public static final class Config {
5+
public static final String SUITES = "E2E_SUITES";
56
public static final String ARGS_JSON = "E2E_ARGS_JSON";
67

78
public static final String ENV = "E2E_ENV";
89
public static final String IDENTITY_SCOPE = "E2E_IDENTITY_SCOPE";
910
public static final String PHONE_SUPPORT = "E2E_PHONE_SUPPORT";
1011

12+
// Local only - Args used for Core E2Es
13+
public static final class Core {
14+
public static final String OPERATOR_API_KEY = "UID2_CORE_E2E_OPERATOR_API_KEY";
15+
public static final String OPTOUT_API_KEY = "UID2_CORE_E2E_OPTOUT_API_KEY";
16+
public static final String CORE_URL = "UID2_CORE_E2E_CORE_URL";
17+
public static final String OPTOUT_URL = "UID2_CORE_E2E_OPTOUT_URL";
18+
}
19+
1120
// Args used for Operator E2Es
1221
public static final class Operator {
1322
public static final String CLIENT_SITE_ID = "UID2_OPERATOR_E2E_CLIENT_SITE_ID";
@@ -25,21 +34,13 @@ public static final class Operator {
2534
public static final String CLIENT_API_KEY_NON_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_KEY_SHARING_NON_RECIPIENT";
2635
public static final String CLIENT_API_SECRET_NON_SHARING_RECIPIENT = "UID2_OPERATOR_E2E_CLIENT_API_SECRET_NON_SHARING_RECIPIENT";
2736

28-
// Local only - Sharing
37+
// Local only - CSTG
2938
public static final String CSTG_SUBSCRIPTION_ID = "UID2_OPERATOR_E2E_CSTG_SUBSCRIPTION_ID";
3039
public static final String CSTG_SERVER_PUBLIC_KEY = "UID2_OPERATOR_E2E_CSTG_SERVER_PUBLIC_KEY";
3140
public static final String CSTG_ORIGIN = "UID2_OPERATOR_E2E_CSTG_ORIGIN";
3241
public static final String CSTG_INVALID_ORIGIN = "UID2_OPERATOR_E2E_CSTG_INVALID_ORIGIN";
3342
}
3443

35-
// Local only - Args used for Core E2Es
36-
public static final class Core {
37-
public static final String OPERATOR_API_KEY = "UID2_CORE_E2E_OPERATOR_API_KEY";
38-
public static final String OPTOUT_API_KEY = "UID2_CORE_E2E_OPTOUT_API_KEY";
39-
public static final String CORE_URL = "UID2_CORE_E2E_CORE_URL";
40-
public static final String OPTOUT_URL = "UID2_CORE_E2E_OPTOUT_URL";
41-
}
42-
4344
// Args used for pipeline setup
4445
public static final class Pipeline {
4546
public static final String CORE_URL = "UID2_PIPELINE_E2E_CORE_URL";

src/test/java/suite/E2ELocalFullTestSuite.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import suite.basic.BasicTest;
66
import suite.core.CoreRefreshTest;
77
import suite.core.CoreTest;
8-
import suite.operator.V0ApiOperatorTest;
9-
import suite.operator.V1ApiOperatorTest;
10-
import suite.operator.V2ApiOperatorPublicOnlyTest;
11-
import suite.operator.V2ApiOperatorTest;
8+
import suite.operator.*;
129
import suite.optout.OptoutTest;
1310
import suite.validator.V0ApiValidatorTest;
1411
import suite.validator.V1ApiValidatorTest;
@@ -23,6 +20,7 @@
2320
V1ApiOperatorTest.class,
2421
V2ApiOperatorTest.class,
2522
V2ApiOperatorPublicOnlyTest.class,
23+
V2ApiOperatorLocalOnlyTest.class,
2624
OptoutTest.class,
2725
V0ApiValidatorTest.class,
2826
V1ApiValidatorTest.class,

src/test/java/suite/E2EPublicOperatorTestSuite.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import suite.basic.BasicTest;
66
import suite.core.CoreRefreshTest;
77
import suite.core.CoreTest;
8-
import suite.operator.V0ApiOperatorTest;
9-
import suite.operator.V1ApiOperatorTest;
10-
import suite.operator.V2ApiOperatorPublicOnlyTest;
11-
import suite.operator.V2ApiOperatorTest;
8+
import suite.operator.*;
129
import suite.optout.OptoutTest;
1310

1411
@Suite
@@ -18,6 +15,7 @@
1815
V1ApiOperatorTest.class,
1916
V2ApiOperatorTest.class,
2017
V2ApiOperatorPublicOnlyTest.class,
18+
V2ApiOperatorLocalOnlyTest.class,
2119
OptoutTest.class
2220
})
2321
public class E2EPublicOperatorTestSuite {

0 commit comments

Comments
 (0)