Skip to content

Commit 36a0736

Browse files
committed
Log which user stopped an app
1 parent fd93492 commit 36a0736

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/eu/openanalytics/containerproxy/service/ProxyService.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ public Command stopProxy(Authentication user, Proxy proxy, boolean ignoreAccessC
300300
if (!ignoreAccessControl && !userService.isAdmin(user) && !userService.isOwner(user, proxy)) {
301301
throw new AccessDeniedException(String.format("Cannot stop proxy %s: access denied", proxy.getId()));
302302
}
303+
304+
if (user != null) {
305+
log.info(proxy, "Proxy being stopped by user " + UserService.getUserId(user));
306+
}
307+
303308
Proxy stoppingProxy = proxy.withStatus(ProxyStatus.Stopping);
304309
proxyStore.updateProxy(stoppingProxy);
305310

@@ -336,6 +341,10 @@ public Command pauseProxy(Authentication user, Proxy proxy, boolean ignoreAccess
336341
throw new IllegalArgumentException("Trying to pause a proxy when the backend does not support pausing apps");
337342
}
338343

344+
if (user != null) {
345+
log.info(proxy, "Proxy being paused by user " + UserService.getUserId(user));
346+
}
347+
339348
Proxy stoppingProxy = proxy.withStatus(ProxyStatus.Pausing);
340349
proxyStore.updateProxy(stoppingProxy);
341350

0 commit comments

Comments
 (0)