Skip to content

Commit

Permalink
Pass proxy realm id to Shiny Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Nov 9, 2020
1 parent 1a64723 commit f665e57
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public abstract class AbstractContainerBackend implements IContainerBackend {
//TODO rename vars?
protected static final String ENV_VAR_USER_NAME = "SHINYPROXY_USERNAME";
protected static final String ENV_VAR_USER_GROUPS = "SHINYPROXY_USERGROUPS";
protected static final String ENV_VAR_REALM_ID = "SHINYPROXY_REALM_ID";

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

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

String realmId = environment.getProperty("proxy.realm-id");
if (realmId != null) {
env.add(String.format("%s=%s", ENV_VAR_REALM_ID, realmId));
}

String envFile = containerSpec.getEnvFile();
if (envFile != null && Files.isRegularFile(Paths.get(envFile))) {
Properties envProps = new Properties();
Expand Down

0 comments on commit f665e57

Please sign in to comment.