Skip to content

Commit

Permalink
Merge pull request #1290 from IABTechLab/bmz-UID2-4606-runtime-config…
Browse files Browse the repository at this point in the history
…-application

Runtime config retrieval and application
  • Loading branch information
BehnamMozafari authored Feb 3, 2025
2 parents 34dbbd9 + 63b0c4b commit 418f2bf
Show file tree
Hide file tree
Showing 45 changed files with 1,226 additions and 199 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ COPY ./target/${JAR_NAME}-${JAR_VERSION}-sources.jar /app
COPY ./target/${JAR_NAME}-${JAR_VERSION}-static.tar.gz /app/static.tar.gz
COPY ./conf/default-config.json ${EXTRA_CONFIG} /app/conf/
COPY ./conf/*.xml /app/conf/
COPY ./conf/runtime-config-defaults.json /app/conf/
COPY ./conf/feat-flag/feat-flag.json /app/conf/feat-flag/

RUN tar xzvf /app/static.tar.gz --no-same-owner --no-same-permissions && rm -f /app/static.tar.gz

Expand Down
1 change: 0 additions & 1 deletion conf/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@
"failure_shutdown_wait_hours": 120,
"sharing_token_expiry_seconds": 2592000,
"operator_type": "public"

}
11 changes: 9 additions & 2 deletions conf/docker-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
"enclave_platform": null,
"failure_shutdown_wait_hours": 120,
"salts_expired_shutdown_hours": 12,
"operator_type": "public"

"operator_type": "public",
"runtime_config_store": {
"type": "file",
"config" : {
"path": "conf/runtime-config-defaults.json",
"format": "json"
},
"config_scan_period_ms": 5000
}
}
5 changes: 5 additions & 0 deletions conf/feat-flag/feat-flag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"remote_config": {
"enabled": true
}
}
12 changes: 10 additions & 2 deletions conf/integ-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"optout_api_token": "test-operator-key",
"optout_api_uri": "http://localhost:8081/optout/replicate",
"salts_expired_shutdown_hours": 12,
"operator_type": "public"

"operator_type": "public",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "localhost",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
10 changes: 9 additions & 1 deletion conf/local-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@
"key_sharing_endpoint_provide_app_names": true,
"client_side_token_generate_log_invalid_http_origins": true,
"salts_expired_shutdown_hours": 12,
"operator_type": "public"
"operator_type": "public",
"runtime_config_store": {
"type": "file",
"config" : {
"path": "conf/runtime-config-defaults.json",
"format": "json"
},
"config_scan_period_ms": 5000
}
}
11 changes: 10 additions & 1 deletion conf/local-e2e-docker-private-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@
"optout_delta_rotate_interval": 60,
"cloud_refresh_interval": 30,
"salts_expired_shutdown_hours": 12,
"operator_type": "private"
"operator_type": "private",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 10 additions & 2 deletions conf/local-e2e-docker-public-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
"optout_status_api_enabled": true,
"cloud_refresh_interval": 30,
"salts_expired_shutdown_hours": 12,
"operator_type": "public"

"operator_type": "public",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 10 additions & 2 deletions conf/local-e2e-private-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
"client_side_token_generate_domain_name_check_enabled": false,
"client_side_token_generate_log_invalid_http_origins": true,
"salts_expired_shutdown_hours": 12,
"operator_type": "private"

"operator_type": "private",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "localhost",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 10 additions & 2 deletions conf/local-e2e-public-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
"key_sharing_endpoint_provide_app_names": true,
"client_side_token_generate_log_invalid_http_origins": true,
"salts_expired_shutdown_hours": 12,
"operator_type": "public"

"operator_type": "public",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "localhost",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
6 changes: 6 additions & 0 deletions conf/runtime-config-defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"identity_token_expires_after_seconds": 3600,
"refresh_token_expires_after_seconds": 86400,
"refresh_identity_token_after_seconds": 900,
"sharing_token_expiry_seconds": 2592000
}
12 changes: 10 additions & 2 deletions conf/validator-latest-e2e-docker-public-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
"optout_api_uri": "http://optout:8081/optout/replicate",
"optout_delta_rotate_interval": 60,
"cloud_refresh_interval": 30,
"operator_type": "public"

"operator_type": "public",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core",
"port": 8088,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
1 change: 1 addition & 0 deletions scripts/aws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ COPY ./conf/default-config.json /app/conf/
COPY ./conf/*.json /app/conf/
COPY ./conf/*.xml /app/conf/
COPY ./syslog-ng-client.conf /etc/syslog-ng/syslog-ng.conf
COPY ./conf/feat-flag/feat-flag.json /app/conf/feat-flag/

RUN chmod +x /app/vsockpx && chmod +x /app/entrypoint.sh

Expand Down
12 changes: 11 additions & 1 deletion scripts/aws/conf/euid-integ-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@
"core_attest_url": "https://core.integ.euid.eu/attest",
"optout_api_uri": "https://optout.integ.euid.eu/optout/replicate",
"optout_s3_folder": "optout/",
"allow_legacy_api": false
"allow_legacy_api": false,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core.integ.euid.eu",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 11 additions & 1 deletion scripts/aws/conf/euid-prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@
"refresh_token_v3": true,
"enable_phone_support": true,
"enable_v1_phone_support": false,
"enable_v2_encryption": true
"enable_v2_encryption": true,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core.prod.euid.eu",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
5 changes: 5 additions & 0 deletions scripts/aws/conf/feat-flag/feat-flag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"remote_config": {
"enabled": false
}
}
12 changes: 11 additions & 1 deletion scripts/aws/conf/uid2-integ-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@
"core_attest_url": "https://core-integ.uidapi.com/attest",
"optout_api_uri": "https://optout-integ.uidapi.com/optout/replicate",
"optout_s3_folder": "uid-optout-integ/",
"allow_legacy_api": false
"allow_legacy_api": false,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core-integ.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 11 additions & 1 deletion scripts/aws/conf/uid2-prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,15 @@
"identity_token_expires_after_seconds": 259200,
"refresh_token_expires_after_seconds": 2592000,
"refresh_identity_token_after_seconds": 3600,
"allow_legacy_api": false
"allow_legacy_api": false,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core-prod.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
1 change: 1 addition & 0 deletions scripts/azure-cc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ COPY ./target/${JAR_NAME}-${JAR_VERSION}-sources.jar /app
COPY ./target/${JAR_NAME}-${JAR_VERSION}-static.tar.gz /app/static.tar.gz
COPY ./conf/*.json /app/conf/
COPY ./conf/*.xml /app/conf/
COPY ./conf/feat-flag/feat-flag.json /app/conf/feat-flag/

# Extract and clean up tar.gz
RUN tar xzvf /app/static.tar.gz --no-same-owner --no-same-permissions && \
Expand Down
5 changes: 5 additions & 0 deletions scripts/azure-cc/conf/feat-flag/feat-flag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"remote_config": {
"enabled": false
}
}
12 changes: 11 additions & 1 deletion scripts/azure-cc/conf/integ-uid2-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"optout_metadata_path": "https://optout-integ.uidapi.com/optout/refresh",
"core_attest_url": "https://core-integ.uidapi.com/attest",
"optout_api_uri": "https://optout-integ.uidapi.com/optout/replicate",
"optout_s3_folder": "uid-optout-integ/"
"optout_s3_folder": "uid-optout-integ/",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core-integ.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 11 additions & 1 deletion scripts/azure-cc/conf/prod-uid2-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@
"core_attest_url": "https://core-prod.uidapi.com/attest",
"optout_api_uri": "https://optout-prod.uidapi.com/optout/replicate",
"optout_s3_folder": "optout-v2/",
"identity_token_expires_after_seconds": 259200
"identity_token_expires_after_seconds": 259200,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core-prod.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
1 change: 1 addition & 0 deletions scripts/gcp-oidc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ COPY ./target/${JAR_NAME}-${JAR_VERSION}-sources.jar /app
COPY ./target/${JAR_NAME}-${JAR_VERSION}-static.tar.gz /app/static.tar.gz
COPY ./conf/*.json /app/conf/
COPY ./conf/*.xml /app/conf/
COPY ./conf/feat-flag/feat-flag.json /app/conf/feat-flag/

RUN tar xzvf /app/static.tar.gz --no-same-owner --no-same-permissions && rm -f /app/static.tar.gz

Expand Down
5 changes: 5 additions & 0 deletions scripts/gcp-oidc/conf/feat-flag/feat-flag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"remote_config": {
"enabled": false
}
}
12 changes: 11 additions & 1 deletion scripts/gcp-oidc/conf/integ-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"optout_metadata_path": "https://optout.uidapi.com/optout/refresh",
"core_attest_url": "https://core.uidapi.com/attest",
"optout_api_uri": "https://optout.uidapi.com/optout/replicate",
"optout_s3_folder": "uid-optout-integ/"
"optout_s3_folder": "uid-optout-integ/",
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
12 changes: 11 additions & 1 deletion scripts/gcp-oidc/conf/prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@
"core_attest_url": "https://core.uidapi.com/attest",
"optout_api_uri": "https://optout.uidapi.com/optout/replicate",
"optout_s3_folder": "optout-v2/",
"identity_token_expires_after_seconds": 259200
"identity_token_expires_after_seconds": 259200,
"runtime_config_store": {
"type": "http",
"config" : {
"host": "core.uidapi.com",
"port": 443,
"ssl": true,
"path": "/operator/config"
},
"config_scan_period_ms": 300000
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/uid2/operator/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ public class Config extends com.uid2.shared.Const.Config {
public static final String OptOutStatusMaxRequestSize = "optout_status_max_request_size";
public static final String MaxInvalidPaths = "logging_limit_max_invalid_paths_per_interval";
public static final String MaxVersionBucketsPerSite = "logging_limit_max_version_buckets_per_site";

public static final String ConfigScanPeriodMsProp = "config_scan_period_ms";
public static final String IdentityV3Prop = "identity_v3";
public static final String RemoteConfigFeatureFlagProp = "remote_config_feature_flag";
}
}
Loading

0 comments on commit 418f2bf

Please sign in to comment.