Skip to content

Commit

Permalink
Merge branch 'devel' into CB-4700-allow-admin-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dariamarutkina authored Feb 22, 2024
2 parents 680bf92 + 379e0cb commit 76f81c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,18 @@ public void reverseProxyAuthentication(@NotNull HttpServletRequest request, @Not
resolveParam(paramConfigMap.get(RPConstants.PARAM_USER), RPAuthProvider.X_USER)
);
String teams = request.getHeader(resolveParam(paramConfigMap.get(RPConstants.PARAM_TEAM), RPAuthProvider.X_TEAM));
if (CommonUtils.isEmpty(teams)) {
// backward compatibility
teams = request.getHeader(RPAuthProvider.X_ROLE);
// backward compatibility
String deprecatedTeams = request.getHeader(RPAuthProvider.X_ROLE);
if (teams == null && deprecatedTeams != null) {
teams = deprecatedTeams;
}
String role = request.getHeader(resolveParam(paramConfigMap.get(RPConstants.PARAM_ROLE_NAME), RPAuthProvider.X_ROLE_TE));
String firstName = request.getHeader(resolveParam(paramConfigMap.get(RPConstants.PARAM_FIRST_NAME), RPAuthProvider.X_FIRST_NAME));
String lastName = request.getHeader(resolveParam(paramConfigMap.get(RPConstants.PARAM_LAST_NAME), RPAuthProvider.X_LAST_NAME));
String logoutUrl = Objects.requireNonNull(configuration).getParameter(RPConstants.PARAM_LOGOUT_URL);
String teamDelimiter = JSONUtils.getString(configuration.getParameters(),
RPConstants.PARAM_TEAM_DELIMITER, "\\|");
List<String> userTeams = teams == null ? Collections.emptyList() : List.of(teams.split(teamDelimiter));
List<String> userTeams = teams == null ? null : (teams.isEmpty() ? List.of() : List.of(teams.split(teamDelimiter)));
if (userName != null) {
try {
Map<String, Object> credentials = new HashMap<>();
Expand Down
2 changes: 1 addition & 1 deletion server/bundles/io.cloudbeaver.service.security/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<property id="team-delimiter" label="Team delimiter symbol" type="string" description="Team delimiter symbol, default: |"/>
<property id="first-name-header" label="First name header" type="string" description="First name header name"/>
<property id="last-name-header" label="Last name header" type="string" description="Last name header name"/>
<property id="role-header" label="Role header" type="string" description="Role header name" features="distributed"/>
<property id="role-header" label="Role header" type="string" description="Role header name" requiredFeatures="distributed"/>
</propertyGroup>
</configuration>
</authProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* you may not use this file except in compliance with the License.
*/
import { Dependency, injectable } from '@cloudbeaver/core-di';
import { ESettingsValueType, INTERFACE_SETTINGS_GROUP, SettingsManagerService } from '@cloudbeaver/core-plugin';
import { SettingsManagerService } from '@cloudbeaver/core-plugin';

import { ThemeService } from './ThemeService';
import { ThemeSettingsService } from './ThemeSettingsService';
Expand All @@ -16,14 +16,14 @@ export class ThemeSettingsManagementService extends Dependency {
constructor(themeSettingsService: ThemeSettingsService, themeService: ThemeService, settingsManagerService: SettingsManagerService) {
super();
settingsManagerService.registerSettings(themeSettingsService.settings, () => [
{
key: 'defaultTheme',
type: ESettingsValueType.Select,
name: 'core_theming_settings_default_theme_name',
description: 'core_theming_settings_default_theme_description',
options: themeService.themes.map(theme => ({ id: theme.id, name: theme.name })),
group: INTERFACE_SETTINGS_GROUP,
},
// {
// key: 'defaultTheme',
// type: ESettingsValueType.Select,
// name: 'core_theming_settings_default_theme_name',
// description: 'core_theming_settings_default_theme_description',
// options: themeService.themes.map(theme => ({ id: theme.id, name: theme.name })),
// group: INTERFACE_SETTINGS_GROUP,
// },
]);
}
}

0 comments on commit 76f81c1

Please sign in to comment.