Skip to content

Commit cd70eeb

Browse files
committed
Fix #25756: option to control shutdown of proxies on logout
1 parent 40e2f04 commit cd70eeb

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

src/main/java/eu/openanalytics/containerproxy/backend/strategy/impl/DefaultProxyLogoutStrategy.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import javax.inject.Inject;
2424

25+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
2526
import org.springframework.stereotype.Component;
2627

2728
import eu.openanalytics.containerproxy.backend.strategy.IProxyLogoutStrategy;
@@ -32,6 +33,7 @@
3233
* Default logout behaviour: stop all proxies owned by the user.
3334
*/
3435
@Component
36+
@ConditionalOnProperty(name = "proxy.stop_proxies_on_logout", havingValue = "true", matchIfMissing = true)
3537
public class DefaultProxyLogoutStrategy implements IProxyLogoutStrategy {
3638

3739
@Inject
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* ContainerProxy
3+
*
4+
* Copyright (C) 2016-2021 Open Analytics
5+
*
6+
* ===========================================================================
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the Apache License as published by
10+
* The Apache Software Foundation, either version 2 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* Apache License for more details.
17+
*
18+
* You should have received a copy of the Apache License
19+
* along with this program. If not, see <http://www.apache.org/licenses/>
20+
*/
21+
package eu.openanalytics.containerproxy.backend.strategy.impl;
22+
23+
import eu.openanalytics.containerproxy.backend.strategy.IProxyLogoutStrategy;
24+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
25+
import org.springframework.stereotype.Component;
26+
27+
/**
28+
* No-op logout behaviour : do nothing on logout of user
29+
*/
30+
@Component
31+
@ConditionalOnProperty(name = "proxy.stop_proxies_on_logout", havingValue = "false")
32+
public class NoOpProxyLogoutStrategy implements IProxyLogoutStrategy {
33+
34+
@Override
35+
public void onLogout(String userId) {
36+
37+
}
38+
39+
}

0 commit comments

Comments
 (0)