mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-19 23:28:03 +01:00
Change type of Cdn3StorageManagerConfiguration.clientSecret to SecretString
This commit is contained in:
committed by
ravi-signal
parent
ba0c6be3e3
commit
a62a6c1cb6
@@ -65,7 +65,7 @@ public class Cdn3RemoteStorageManager implements RemoteStorageManager {
|
||||
// strip trailing "/" for easier URI construction
|
||||
this.storageManagerBaseUrl = StringUtils.removeEnd(configuration.baseUri(), "/");
|
||||
this.clientId = configuration.clientId();
|
||||
this.clientSecret = configuration.clientSecret();
|
||||
this.clientSecret = configuration.clientSecret().value();
|
||||
|
||||
// Client used to read/write to cdn
|
||||
this.cdnHttpClient = FaultTolerantHttpClient.newBuilder()
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.whispersystems.textsecuregcm.configuration;
|
||||
|
||||
import org.whispersystems.textsecuregcm.configuration.secrets.SecretString;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public record Cdn3StorageManagerConfiguration(
|
||||
String baseUri,
|
||||
String clientId,
|
||||
String clientSecret) {}
|
||||
@NotNull String baseUri,
|
||||
@NotNull String clientId,
|
||||
@NotNull SecretString clientSecret) {}
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.whispersystems.textsecuregcm.configuration.Cdn3StorageManagerConfiguration;
|
||||
import org.whispersystems.textsecuregcm.configuration.CircuitBreakerConfiguration;
|
||||
import org.whispersystems.textsecuregcm.configuration.RetryConfiguration;
|
||||
import org.whispersystems.textsecuregcm.configuration.secrets.SecretString;
|
||||
import org.whispersystems.textsecuregcm.util.CompletableFutureTestUtil;
|
||||
import org.whispersystems.textsecuregcm.util.SystemMapper;
|
||||
import org.whispersystems.textsecuregcm.util.TestRandomUtil;
|
||||
@@ -71,7 +72,10 @@ public class Cdn3RemoteStorageManagerTest {
|
||||
new CircuitBreakerConfiguration(),
|
||||
new RetryConfiguration(),
|
||||
Collections.emptyList(),
|
||||
new Cdn3StorageManagerConfiguration(wireMock.url("storage-manager/"), "clientId", "clientSecret"));
|
||||
new Cdn3StorageManagerConfiguration(
|
||||
wireMock.url("storage-manager/"),
|
||||
"clientId",
|
||||
new SecretString("clientSecret")));
|
||||
|
||||
wireMock.stubFor(get(urlEqualTo("/cdn2/source/small"))
|
||||
.willReturn(aResponse()
|
||||
|
||||
Reference in New Issue
Block a user