Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre authored and johnksv committed Aug 22, 2023
1 parent 0786de5 commit 2dcd68d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,12 @@ private Collection<Object> publishApps(
Map<String, Object> fusion = new HashMap<>();
fusion.putAll((Map<String, Object>) requestDTO.getOptions());
// Substitute userAttribute value with actual value from user's attributes map
// This is a hack while we wait for this issue to be fixed: https://github.com/InseeFrLab/onyxia-web/issues/410
// This is a hack while we wait for this issue to be fixed:
// https://github.com/InseeFrLab/onyxia-web/issues/410
if (fusion.containsKey("userAttributes") && fusion.get("userAttributes") != null) {
Map<String, Object> props = (Map<String, Object>) fusion.get("userAttributes");
props.replace("value", user.getAttributes().getOrDefault(props.get("userAttribute"), ""));
props.replace(
"value", user.getAttributes().getOrDefault(props.get("userAttribute"), ""));
}
return helmAppsService.installApp(
region, project, requestDTO, catalogId, pkg, user, fusion, skipTlsVerify, caFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ public class NoSecurityUserProvider {
@Bean
public UserProvider getUserProvider() {
return (Region region) -> {
final User user = User.newInstance()
.setEmail("[email protected]")
.setNomComplet("John doe")
.setIdep("default")
.setIp(
httpRequestUtils.getClientIpAddressIfServletRequestExist(
((ServletRequestAttributes)
RequestContextHolder
.currentRequestAttributes())
.getRequest()))
.build();
final User user =
User.newInstance()
.setEmail("[email protected]")
.setNomComplet("John doe")
.setIdep("default")
.setIp(
httpRequestUtils.getClientIpAddressIfServletRequestExist(
((ServletRequestAttributes)
RequestContextHolder
.currentRequestAttributes())
.getRequest()))
.build();
user.getAttributes().put("preferred_username", "toto");
user.getAttributes().put("access_token", "mock-token-string");
return user;
Expand Down

0 comments on commit 2dcd68d

Please sign in to comment.