Create GCP Logging implementation of AdminEventLogger

This commit is contained in:
Ehren Kret
2022-08-26 16:49:05 -05:00
parent a4508ec84f
commit abd0f9630c
8 changed files with 87 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.signal.event.Logger;
import org.signal.event.AdminEventLogger;
import org.signal.event.RemoteConfigSetEvent;
import org.whispersystems.textsecuregcm.auth.AuthenticatedAccount;
import org.whispersystems.textsecuregcm.entities.UserRemoteConfig;
@@ -45,15 +45,15 @@ import org.whispersystems.textsecuregcm.util.Conversions;
public class RemoteConfigController {
private final RemoteConfigsManager remoteConfigsManager;
private final Logger eventLogger;
private final AdminEventLogger adminEventLogger;
private final List<String> configAuthTokens;
private final Map<String, String> globalConfig;
private static final String GLOBAL_CONFIG_PREFIX = "global.";
public RemoteConfigController(RemoteConfigsManager remoteConfigsManager, Logger eventLogger, List<String> configAuthTokens, Map<String, String> globalConfig) {
public RemoteConfigController(RemoteConfigsManager remoteConfigsManager, AdminEventLogger adminEventLogger, List<String> configAuthTokens, Map<String, String> globalConfig) {
this.remoteConfigsManager = remoteConfigsManager;
this.eventLogger = Objects.requireNonNull(eventLogger);
this.adminEventLogger = Objects.requireNonNull(adminEventLogger);
this.configAuthTokens = configAuthTokens;
this.globalConfig = globalConfig;
}
@@ -93,7 +93,7 @@ public class RemoteConfigController {
throw new WebApplicationException(Response.Status.FORBIDDEN);
}
eventLogger.logEvent(
adminEventLogger.logEvent(
new RemoteConfigSetEvent(
configToken,
config.getName(),