From cd8f74e60b3ea6fd42509fa99677f1474f51f6a7 Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Thu, 25 May 2023 15:39:14 -0500 Subject: [PATCH] Add support for environment-dependent secondary OAuth2 credentials JSON --- service/config/sample.yml | 9 +++++++++ .../textsecuregcm/WhisperServerService.java | 18 ++++++++++++++---- .../AdminEventLoggingConfiguration.java | 1 + .../configuration/RecaptchaConfiguration.java | 15 ++------------- .../RegistrationServiceConfiguration.java | 1 + 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/service/config/sample.yml b/service/config/sample.yml index f3e93d56c..b5593f379 100644 --- a/service/config/sample.yml +++ b/service/config/sample.yml @@ -44,6 +44,10 @@ adminEventLoggingConfiguration: { "key": "value" } + secondaryCredentials: | + { + "key": "value" + } projectId: some-project-id logName: some-log-name @@ -225,6 +229,7 @@ unidentifiedDelivery: recaptcha: projectPath: projects/example credentialConfigurationJson: "{ }" # service account configuration for backend authentication + secondaryCredentialConfigurationJson: "{ }" # service account configuration for backend authentication hCaptcha: apiKey: secret://hCaptcha.apiKey @@ -376,6 +381,10 @@ registrationService: { "example": "example" } + secondaryCredentialConfigurationJson: | + { + "example": "example" + } identityTokenAudience: https://registration.example.com registrationCaCertificate: | # Registration service TLS certificate trust root -----BEGIN CERTIFICATE----- diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index f57912efb..c95921e98 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -311,6 +311,10 @@ public class WhisperServerService extends Application