Skip to content

Commit f665e57

Browse files
committed
Pass proxy realm id to Shiny Apps
1 parent 1a64723 commit f665e57

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/eu/openanalytics/containerproxy/backend/AbstractContainerBackend.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public abstract class AbstractContainerBackend implements IContainerBackend {
6868
//TODO rename vars?
6969
protected static final String ENV_VAR_USER_NAME = "SHINYPROXY_USERNAME";
7070
protected static final String ENV_VAR_USER_GROUPS = "SHINYPROXY_USERGROUPS";
71+
protected static final String ENV_VAR_REALM_ID = "SHINYPROXY_REALM_ID";
7172

7273
protected final Logger log = LogManager.getLogger(getClass());
7374

@@ -191,6 +192,11 @@ protected List<String> buildEnv(ContainerSpec containerSpec, Proxy proxy) throws
191192
String[] groups = userService.getGroups(userService.getCurrentAuth());
192193
env.add(String.format("%s=%s", ENV_VAR_USER_GROUPS, Arrays.stream(groups).collect(Collectors.joining(","))));
193194

195+
String realmId = environment.getProperty("proxy.realm-id");
196+
if (realmId != null) {
197+
env.add(String.format("%s=%s", ENV_VAR_REALM_ID, realmId));
198+
}
199+
194200
String envFile = containerSpec.getEnvFile();
195201
if (envFile != null && Files.isRegularFile(Paths.get(envFile))) {
196202
Properties envProps = new Properties();

0 commit comments

Comments
 (0)