Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-5807. Implemented logic to get localized text by locale, translate… #3117

Merged
merged 21 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2f07b23
CB-5807. Implemented logic to get localized text by locale, translate…
DenisSinelnikov Dec 4, 2024
52d0d70
CB-5807. Refactor after review
DenisSinelnikov Dec 10, 2024
ea316fa
CB-5807. Refactor after review, move logic to base class
DenisSinelnikov Dec 10, 2024
e4f8d4d
CB-5807. Refactor after review, move logic to base class
DenisSinelnikov Dec 10, 2024
12c558a
CB-5807. Added new translation for IP
DenisSinelnikov Dec 10, 2024
bc7a813
CB-5807. Refactor after review
DenisSinelnikov Dec 11, 2024
8bade97
CB-5807. Refactor after review
DenisSinelnikov Dec 11, 2024
721d679
CB-5807. Refactor after review
DenisSinelnikov Dec 11, 2024
21787b4
Merge branch 'devel' into CB-5807-localize-backend-text
mr-anton-t Dec 12, 2024
8bbb7ce
Merge branch 'devel' into CB-5807-localize-backend-text
mr-anton-t Dec 12, 2024
f5eec50
Merge branch 'devel' into CB-5807-localize-backend-text
EvgeniaBzzz Dec 13, 2024
3d212a3
Merge branch 'devel' into CB-5807-localize-backend-text
DenisSinelnikov Dec 13, 2024
0e41be4
CB-5807. Fixed typo in ru locale
DenisSinelnikov Dec 13, 2024
681d926
Merge branch 'devel' into CB-5807-localize-backend-text
EvgeniaBzzz Dec 16, 2024
33ba65b
CB-5807. Refactor after review
DenisSinelnikov Dec 16, 2024
f68d3cf
Merge remote-tracking branch 'origin/CB-5807-localize-backend-text' i…
DenisSinelnikov Dec 16, 2024
6965284
CB-5807. Revert
DenisSinelnikov Dec 17, 2024
dc30447
Merge branch 'devel' into CB-5807-localize-backend-text
EvgeniaBzzz Dec 17, 2024
c545f3f
CB-5807. Remove comment
DenisSinelnikov Dec 17, 2024
b1283b2
Merge remote-tracking branch 'origin/CB-5807-localize-backend-text' i…
DenisSinelnikov Dec 17, 2024
b7bbc06
Merge branch 'devel' into CB-5807-localize-backend-text
yagudin10 Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPImage;
import org.jkiss.dbeaver.model.DBPNamedObjectLocalized;
import org.jkiss.dbeaver.model.DBPObjectWithDescriptionLocalized;
import org.jkiss.dbeaver.model.auth.AuthPropertyDescriptor;
import org.jkiss.dbeaver.model.auth.SMAuthProvider;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
Expand Down Expand Up @@ -73,7 +75,7 @@ public WebAuthProviderDescriptor(IConfigurationElement cfg) {
this.isCaseInsensitive = CommonUtils.toBoolean(cfg.getAttribute("caseInsensitive"));

for (IConfigurationElement cfgElement : cfg.getChildren("configuration")) {
List<WebAuthProviderProperty> properties = WebAuthProviderRegistry.readProperties(cfgElement);
List<WebAuthProviderProperty> properties = WebAuthProviderRegistry.readProperties(cfgElement, getId());
for (WebAuthProviderProperty property : properties) {
configurationParameters.put(CommonUtils.toString(property.getId()), property);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
import org.eclipse.core.runtime.IConfigurationElement;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.impl.PropertyDescriptor;
import org.jkiss.dbeaver.model.impl.LocalizedPropertyDescriptor;

public class WebAuthProviderProperty extends PropertyDescriptor {
public class WebAuthProviderProperty extends LocalizedPropertyDescriptor {
private final String[] requiredFeatures;
@Nullable
private final String type;

public WebAuthProviderProperty(String category, IConfigurationElement config) {
private final String authProviderId;

public WebAuthProviderProperty(String category, IConfigurationElement config, String authProviderId) {
super(category, config);
this.authProviderId = authProviderId;
String featuresAttr = config.getAttribute("requiredFeatures");
this.requiredFeatures = featuresAttr == null ? new String[0] : featuresAttr.split(",");
this.type = config.getAttribute("type");
Expand All @@ -42,4 +45,13 @@ public String[] getRequiredFeatures() {
public String getType() {
return type;
}

@Override
public String getPropertyId() {
if (authProviderId != null) {
return "prop.auth.model." + authProviderId + "." + this.getId();
} else {
return "prop.auth.model." + this.getId();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ private void loadExtensions(IExtensionRegistry registry) {
}
}

static List<WebAuthProviderProperty> readProperties(IConfigurationElement root) {
static List<WebAuthProviderProperty> readProperties(IConfigurationElement root, String authProviderId) {
List<WebAuthProviderProperty> properties = new ArrayList<>();
for (IConfigurationElement propGroup : ArrayUtils.safeArray(root.getChildren(PropertyDescriptor.TAG_PROPERTY_GROUP))) {
String category = propGroup.getAttribute(PropertyDescriptor.ATTR_LABEL);
IConfigurationElement[] propElements = propGroup.getChildren(PropertyDescriptor.TAG_PROPERTY);
for (IConfigurationElement prop : propElements) {
WebAuthProviderProperty propertyDescriptor = new WebAuthProviderProperty(category, prop);
WebAuthProviderProperty propertyDescriptor = new WebAuthProviderProperty(category, prop, authProviderId);
properties.add(propertyDescriptor);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class WebCommonAuthProviderPropertyDescriptor extends AbstractDescriptor

public WebCommonAuthProviderPropertyDescriptor(IConfigurationElement cfg) {
super(cfg);
configurationParameters = WebAuthProviderRegistry.readProperties(cfg);
configurationParameters = WebAuthProviderRegistry.readProperties(cfg, null);
String supportedCategoriesAttr = cfg.getAttribute("supportedProviderCategories");
if (CommonUtils.isNotEmpty(supportedCategoriesAttr)) {
supportedProviderCategories.addAll(Arrays.stream(supportedCategoriesAttr.split(",")).toList());
Expand Down
1 change: 1 addition & 0 deletions server/bundles/io.cloudbeaver.server/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ Export-Package: io.cloudbeaver,
io.cloudbeaver.service.navigator,
io.cloudbeaver.service.sql
Import-Package: org.slf4j
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: io.cloudbeaver.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
log.api.graphql.debug = Enable detailed logging
log.api.graphql.debug.description = Enable detailed logging of GraphQL queries in the server log, including all provided variables
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
log.api.graphql.debug = \u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0435 \u043B\u043E\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435
log.api.graphql.debug.description = \u0412\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0435 \u043B\u043E\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432 GraphQL \u0432 \u0436\u0443\u0440\u043D\u0430\u043B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0432\u0441\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435
1 change: 1 addition & 0 deletions server/bundles/io.cloudbeaver.server/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
schema/,\
static/,\
plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.cloudbeaver.auth.SMAuthProviderFederated;
import io.cloudbeaver.auth.provisioning.SMProvisioner;
import io.cloudbeaver.model.app.ServletAuthConfiguration;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.registry.WebAuthProviderConfiguration;
import io.cloudbeaver.registry.WebAuthProviderDescriptor;
import io.cloudbeaver.server.CBApplication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Bundle-ClassPath: .
Require-Bundle: org.jkiss.dbeaver.model;visibility:=reexport,
org.jkiss.dbeaver.registry;visibility:=reexport,
io.cloudbeaver.model
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: io.cloudbeaver.service.ldap.auth
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
prop.auth.model.ldap.ldap-host = Host
prop.auth.model.ldap.ldap-host.description = LDAP server host
prop.auth.model.ldap.ldap-port = Port
prop.auth.model.ldap.ldap-port.description = LDAP server port, default is 389
prop.auth.model.ldap.ldap-identifier-attr = User identifier attribute
prop.auth.model.ldap.ldap-identifier-attr.description = LDAP attribute used as a user ID. Will be automatically added to the beginning of the 'User DN' value during authorization if not explicitly specified
prop.auth.model.ldap.ldap-dn = Base Distinguished Name
prop.auth.model.ldap.ldap-dn.description = Base Distinguished Name applicable for all users, example: dc=myOrg,dc=com. Will be automatically added to the end of the 'User DN' value during authorization if not explicitly specified
prop.auth.model.ldap.ldap-bind-user = Bind User DN
prop.auth.model.ldap.ldap-bind-user.description = DN of user, who has permissions to search for users to check access to the application with the specified filter.
prop.auth.model.ldap.ldap-bind-user-pwd = Bind User Password
prop.auth.model.ldap.ldap-bind-user-pwd.description = Bind user password.
prop.auth.model.ldap.ldap-filter = User Filter
prop.auth.model.ldap.ldap-filter.description = Filter that will be used to verify users access to the application. To use the filter, the bind user configuration is mandatory.
prop.auth.model.ldap.user-dn = User DN
prop.auth.model.ldap.user-dn.description = LDAP user name
prop.auth.model.ldap.password = User password
prop.auth.model.ldap.password.description = LDAP user password

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
prop.auth.model.ldap.ldap-host = \u0425\u043E\u0441\u0442
prop.auth.model.ldap.ldap-host.description = \u0425\u043E\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 LDAP
prop.auth.model.ldap.ldap-port = \u041F\u043E\u0440\u0442
prop.auth.model.ldap.ldap-port.description = \u041F\u043E\u0440\u0442 LDAP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E 389
prop.auth.model.ldap.ldap-identifier-attr = \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.ldap-identifier-attr.description = \u0410\u0442\u0440\u0438\u0431\u0443\u0442 LDAP, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u044B\u0439 \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F. \u0411\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u0432 \u043D\u0430\u0447\u0430\u043B\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F 'User DN' \u043F\u0440\u0438 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0435\u0441\u043B\u0438 \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D \u044F\u0432\u043D\u043E
prop.auth.model.ldap.ldap-dn = \u0411\u0430\u0437\u043E\u0432\u043E\u0435 \u043E\u0442\u043B\u0438\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F
prop.auth.model.ldap.ldap-dn.description = \u0411\u0430\u0437\u043E\u0432\u043E\u0435 \u043E\u0442\u043B\u0438\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F, \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E\u0435 \u043A\u043E \u0432\u0441\u0435\u043C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F\u043C, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: dc=myOrg,dc=com. \u0411\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0432 \u043A\u043E\u043D\u0435\u0446 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F 'User DN' \u043F\u0440\u0438 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0435\u0441\u043B\u0438 \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u043E \u044F\u0432\u043D\u043E
prop.auth.model.ldap.ldap-bind-user = \u041F\u0440\u0438\u0432\u044F\u0437\u043A\u0430 DN \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.ldap-bind-user.description = DN \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0438\u043C\u0435\u0435\u0442 \u043F\u0440\u0430\u0432\u0430 \u043D\u0430 \u043F\u043E\u0438\u0441\u043A \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043A \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044E \u0441 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C.
prop.auth.model.ldap.ldap-bind-user-pwd = \u0421\u0432\u044F\u0437\u0430\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.ldap-bind-user-pwd.description = \u041F\u0440\u0438\u0432\u044F\u0437\u043A\u0430 \u043F\u0430\u0440\u043E\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F.
prop.auth.model.ldap.ldap-filter = \u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.ldap-filter.description = \u0424\u0438\u043B\u044C\u0442\u0440, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u0439 \u043A \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044E. \u0414\u043B\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u0430 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 bind user.
prop.auth.model.ldap.user-dn = \u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F DN
prop.auth.model.ldap.user-dn.description = LDAP \u0438\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.password = \u041F\u0430\u0440\u043E\u043B\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
prop.auth.model.ldap.password.description = LDAP \u043F\u0430\u0440\u043E\u043B\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
plugin.xml
25 changes: 12 additions & 13 deletions server/bundles/io.cloudbeaver.service.ldap.auth/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@
>
<configuration>
<propertyGroup label="LDAP" description="LDAP authentication">
<property id="ldap-host" label="Host" type="string" description="LDAP server host" required="true"/>
<property id="ldap-port" label="Port" type="integer" defaultValue="389" required="true" description="LDAP server port, default is 389"/>
<property id="ldap-identifier-attr" label="User identifier attribute"
<property id="ldap-host" label="%ldap-host" type="string" description="%ldap-host.description" required="true"/>
<property id="ldap-port" label="%ldap-port" type="integer" defaultValue="389" required="true" description="%ldap-port.description"/>
<property id="ldap-identifier-attr" label="%ldap-identifier-attr"
defaultValue="cn"
required="true"
description="LDAP attribute used as a user ID. Will be automatically added to the beginning of the 'User DN' value during authorization if not explicitly specified"/>
<property id="ldap-dn" label="Base Distinguished Name" type="string"
description="Base Distinguished Name applicable for all users, example: dc=myOrg,dc=com. Will be automatically added to the end of the 'User DN' value during authorization if not explicitly specified"
description="%ldap-identifier-attr.description"/>
<property id="ldap-dn" label="%ldap-dn" type="string"
description="%ldap-dn.description"
required="false"/>
<property id="ldap-bind-user" label="Bind User DN" type="string"
description="DN of user, who has permissions to search for users to check access to the application with the specified filter."
<property id="ldap-bind-user" label="%ldap-bind-user" type="string"
description="%ldap-bind-user.description"
required="false"/>
<property id="ldap-bind-user-pwd" label="Bind User Password" type="string"
description="Bind user password."
<property id="ldap-bind-user-pwd" label="%ldap-bind-user-pwd" type="string"
description="%ldap-bind-user-pwd.description"
features="password" required="false"/>
<property id="ldap-filter " label="User Filter" type="string" required="false"
description="Filter that will be used to verify users access to the application.To use the filter, the bind user configuration is mandatory."
/>
<property id="ldap-filter" label="%ldap-filter" type="string" required="false"
description="%ldap-filter.description"/>
</propertyGroup>
</configuration>
<credentials>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Export-Package: io.cloudbeaver.auth.provider.local,
io.cloudbeaver.auth.provider.rp,
io.cloudbeaver.service.security,
io.cloudbeaver.service.security.db
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: io.cloudbeaver.service.security
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prop.auth.model.reverseProxy.logout-url = Logout URL
prop.auth.model.reverseProxy.logout-url.description = Logout URL
prop.auth.model.reverseProxy.user-header = Username header
prop.auth.model.reverseProxy.user-header.description = Username header
prop.auth.model.reverseProxy.team-header = Team header
prop.auth.model.reverseProxy.team-header.description = Team header
prop.auth.model.reverseProxy.team-delimiter = Team delimiter symbol
prop.auth.model.reverseProxy.team-delimiter.description = Team delimiter symbol, default: |
prop.auth.model.reverseProxy.first-name-header = First name header
prop.auth.model.reverseProxy.first-name-header.description = First name header name
prop.auth.model.reverseProxy.last-name-header = Last name header
prop.auth.model.reverseProxy.last-name-header.description = Last name header name
prop.auth.model.reverseProxy.full-name-header = Full name header
prop.auth.model.reverseProxy.full-name-header.description = Full name header name
prop.auth.model.reverseProxy.role-header = Role header
prop.auth.model.reverseProxy.role-header.description = Role header name
Loading
Loading