Browse Source

Merge pull request #17865 from abpframework/ldaps

Add `LDAP over SSL` setting.
pull/17905/head
Engincan VESKE 2 years ago
committed by GitHub
parent
commit
191ea65d2c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs
  2. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/ILdapSettingProvider.cs
  3. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/LdapSettingNames.cs
  4. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ar.json
  5. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/cs.json
  6. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/de-DE.json
  7. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/el.json
  8. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/en-GB.json
  9. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/en.json
  10. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/es.json
  11. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fa.json
  12. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fi.json
  13. 26
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fr.json
  14. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/hi.json
  15. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/hu.json
  16. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/is.json
  17. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/it.json
  18. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/nl.json
  19. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/pl-PL.json
  20. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/pt-BR.json
  21. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ro-RO.json
  22. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ru.json
  23. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/sk.json
  24. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/sl.json
  25. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/tr.json
  26. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/vi.json
  27. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/zh-Hans.json
  28. 2
      framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/zh-Hant.json
  29. 6
      framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingDefinitionProvider.cs
  30. 17
      framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingProvider.cs

9
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs

@ -14,12 +14,13 @@ public class AbpBlazorMessageLocalizerHelper<T>
this.stringLocalizer = stringLocalizer;
}
public string Localize(string message, IEnumerable<string>? arguments)
public string Localize(string message, IEnumerable<string>? arguments = null)
{
try
{
return arguments?.Count() > 0
? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()!]
var argumentsList = arguments?.ToList();
return argumentsList?.Count > 0
? stringLocalizer[message, LocalizeMessageArguments(argumentsList)]
: stringLocalizer[message];
}
catch
@ -28,7 +29,7 @@ public class AbpBlazorMessageLocalizerHelper<T>
}
}
private IEnumerable<string> LocalizeMessageArguments(IEnumerable<string> arguments)
private IEnumerable<string> LocalizeMessageArguments(List<string> arguments)
{
foreach (var argument in arguments)
{

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/ILdapSettingProvider.cs

@ -4,6 +4,8 @@ namespace Volo.Abp.Ldap;
public interface ILdapSettingProvider
{
public Task<bool> GetLdapOverSsl();
public Task<string?> GetServerHostAsync();
public Task<int> GetServerPortAsync();

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/LdapSettingNames.cs

@ -2,6 +2,8 @@
public static class LdapSettingNames
{
public const string Ldaps = "Abp.Ldap.Ldaps";
public const string ServerHost = "Abp.Ldap.ServerHost";
public const string ServerPort = "Abp.Ldap.ServerPort";

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ar.json

@ -1,6 +1,8 @@
{
"culture": "ar",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP عبر SSL",
"Description:Abp.Ldap.Ldaps": "LDAP عبر SSL",
"DisplayName:Abp.Ldap.ServerHost": "اسم الخادم",
"Description:Abp.Ldap.ServerHost": "اسم الخادم",
"DisplayName:Abp.Ldap.ServerPort": "منفذ الخادم",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/cs.json

@ -1,6 +1,8 @@
{
"culture": "cs",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP přes SSL",
"Description:Abp.Ldap.Ldaps": "LDAP přes SSL",
"DisplayName:Abp.Ldap.ServerHost": "Hostitel serveru",
"Description:Abp.Ldap.ServerHost": "Hostitel serveru",
"DisplayName:Abp.Ldap.ServerPort": "Port serveru",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/de-DE.json

@ -1,6 +1,8 @@
{
"culture": "de-DE",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP über SSL",
"Description:Abp.Ldap.Ldaps": "LDAP über SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server-Host",
"Description:Abp.Ldap.ServerHost": "Server-Host",
"DisplayName:Abp.Ldap.ServerPort": "Server-Port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/el.json

@ -1,6 +1,8 @@
{
"culture": "el",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP μέσω SSL",
"Description:Abp.Ldap.Ldaps": "LDAP μέσω SSL",
"DisplayName:Abp.Ldap.ServerHost": "Κεντρικός διακομιστής",
"Description:Abp.Ldap.ServerHost": "Κεντρικός διακομιστής",
"DisplayName:Abp.Ldap.ServerPort": "Θύρα",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/en-GB.json

@ -1,6 +1,8 @@
{
"culture": "en-GB",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP over SSL",
"Description:Abp.Ldap.Ldaps": "LDAP over SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Server port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/en.json

@ -1,6 +1,8 @@
{
"culture": "en",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP over SSL",
"Description:Abp.Ldap.Ldaps": "LDAP over SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Server port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/es.json

@ -1,6 +1,8 @@
{
"culture": "es",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP sobre SSL",
"Description:Abp.Ldap.Ldaps": "LDAP sobre SSL",
"DisplayName:Abp.Ldap.ServerHost": "Host del servidor",
"Description:Abp.Ldap.ServerHost": "Host del servidor",
"DisplayName:Abp.Ldap.ServerPort": "Puerto del servidor",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fa.json

@ -1,6 +1,8 @@
{
"culture": "fa",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP از طریق SSL",
"Description:Abp.Ldap.Ldaps": "LDAP از طریق SSL",
"DisplayName:Abp.Ldap.ServerHost": "میزبان سرور",
"Description:Abp.Ldap.ServerHost": "میزبان سرور",
"DisplayName:Abp.Ldap.ServerPort": "پورت سرور",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fi.json

@ -1,6 +1,8 @@
{
"culture": "fi",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP SSL:n kautta",
"Description:Abp.Ldap.Ldaps": "LDAP SSL:n kautta",
"DisplayName:Abp.Ldap.ServerHost": "Palvelimen isäntä",
"Description:Abp.Ldap.ServerHost": "Palvelimen isäntä",
"DisplayName:Abp.Ldap.ServerPort": "Palvelimen portti",

26
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/fr.json

@ -1,17 +1,19 @@
{
"culture": "fr",
"texts": {
"DisplayName:Abp.Ldap.ServerHost": "Hôte du serveur",
"Description:Abp.Ldap.ServerHost": "Hôte du serveur",
"DisplayName:Abp.Ldap.ServerPort": "Port de serveur",
"Description:Abp.Ldap.ServerPort": "Port de serveur",
"DisplayName:Abp.Ldap.BaseDc": "Composant de domaine de base",
"Description:Abp.Ldap.BaseDc": "Composant de domaine de base",
"DisplayName:Abp.Ldap.Domain": "Domaine",
"Description:Abp.Ldap.Domain": "Domaine",
"DisplayName:Abp.Ldap.UserName": "Nom d'utilisateur",
"Description:Abp.Ldap.UserName": "Nom d'utilisateur",
"DisplayName:Abp.Ldap.Password": "Mot de passe",
"Description:Abp.Ldap.Password": "Mot de passe"
"DisplayName:Abp.Ldap.Ldaps": "LDAP sur SSL",
"Description:Abp.Ldap.Ldaps": "LDAP sur SSL",
"DisplayName:Abp.Ldap.ServerHost": "Hôte du serveur",
"Description:Abp.Ldap.ServerHost": "Hôte du serveur",
"DisplayName:Abp.Ldap.ServerPort": "Port de serveur",
"Description:Abp.Ldap.ServerPort": "Port de serveur",
"DisplayName:Abp.Ldap.BaseDc": "Composant de domaine de base",
"Description:Abp.Ldap.BaseDc": "Composant de domaine de base",
"DisplayName:Abp.Ldap.Domain": "Domaine",
"Description:Abp.Ldap.Domain": "Domaine",
"DisplayName:Abp.Ldap.UserName": "Nom d'utilisateur",
"Description:Abp.Ldap.UserName": "Nom d'utilisateur",
"DisplayName:Abp.Ldap.Password": "Mot de passe",
"Description:Abp.Ldap.Password": "Mot de passe"
}
}

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/hi.json

@ -1,6 +1,8 @@
{
"culture": "hi",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "एसएसएल पर एलडीएपी",
"Description:Abp.Ldap.Ldaps": "एसएसएल पर एलडीएपी",
"DisplayName:Abp.Ldap.ServerHost": "सर्वर होस्ट",
"Description:Abp.Ldap.ServerHost": "सर्वर होस्ट",
"DisplayName:Abp.Ldap.ServerPort": "सर्वर पोर्ट",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/hu.json

@ -1,6 +1,8 @@
{
"culture": "hu",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP SSL-n keresztül",
"Description:Abp.Ldap.Ldaps": "LDAP SSL-n keresztül",
"DisplayName:Abp.Ldap.ServerHost": "Szerver host",
"Description:Abp.Ldap.ServerHost": "Az LDAP ksizolgáló szerver hostneve vagy IP címe",
"DisplayName:Abp.Ldap.ServerPort": "Szerver port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/is.json

@ -1,6 +1,8 @@
{
"culture": "is",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP yfir SSL",
"Description:Abp.Ldap.Ldaps": "LDAP yfir SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Server port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/it.json

@ -1,6 +1,8 @@
{
"culture": "it",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP su SSL",
"Description:Abp.Ldap.Ldaps": "LDAP su SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Porta del server",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/nl.json

@ -1,6 +1,8 @@
{
"culture": "nl",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP via SSL",
"Description:Abp.Ldap.Ldaps": "LDAP via SSL",
"DisplayName:Abp.Ldap.ServerHost": "Serverhost",
"Description:Abp.Ldap.ServerHost": "Serverhost",
"DisplayName:Abp.Ldap.ServerPort": "Server poort",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/pl-PL.json

@ -1,6 +1,8 @@
{
"culture": "pl-PL",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP przez SSL",
"Description:Abp.Ldap.Ldaps": "LDAP przez SSL",
"DisplayName:Abp.Ldap.ServerHost": "Host serwera",
"Description:Abp.Ldap.ServerHost": "Host serwera",
"DisplayName:Abp.Ldap.ServerPort": "Port serwera",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/pt-BR.json

@ -1,6 +1,8 @@
{
"culture": "pt-BR",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP sobre SSL",
"Description:Abp.Ldap.Ldaps": "LDAP sobre SSL",
"DisplayName:Abp.Ldap.ServerHost": "Host do servidor",
"Description:Abp.Ldap.ServerHost": "Host do servidor",
"DisplayName:Abp.Ldap.ServerPort": "Porta do servidor",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ro-RO.json

@ -1,6 +1,8 @@
{
"culture": "ro-RO",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP peste SSL",
"Description:Abp.Ldap.Ldaps": "LDAP peste SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Server port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/ru.json

@ -1,6 +1,8 @@
{
"culture": "ru",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP через SSL",
"Description:Abp.Ldap.Ldaps": "LDAP через SSL",
"DisplayName:Abp.Ldap.ServerHost": "Хост сервера",
"Description:Abp.Ldap.ServerHost": "Хост сервера",
"DisplayName:Abp.Ldap.ServerPort": "Порт сервера",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/sk.json

@ -1,6 +1,8 @@
{
"culture": "sk",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP cez SSL",
"Description:Abp.Ldap.Ldaps": "LDAP cez SSL",
"DisplayName:Abp.Ldap.ServerHost": "Server host",
"Description:Abp.Ldap.ServerHost": "Server host",
"DisplayName:Abp.Ldap.ServerPort": "Server port",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/sl.json

@ -1,6 +1,8 @@
{
"culture": "sl",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP preko SSL",
"Description:Abp.Ldap.Ldaps": "LDAP preko SSL",
"DisplayName:Abp.Ldap.ServerHost": "Gostitelj strežnika",
"Description:Abp.Ldap.ServerHost": "Gostitelj strežnika",
"DisplayName:Abp.Ldap.ServerPort": "Vrata strežnika",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/tr.json

@ -1,6 +1,8 @@
{
"culture": "tr",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "SSL üzerinden LDAP",
"Description:Abp.Ldap.Ldaps": "SSL üzerinden LDAP",
"DisplayName:Abp.Ldap.ServerHost": "Sunucu Ana Bilgisayarı",
"Description:Abp.Ldap.ServerHost": "Sunucu Ana Bilgisayarı",
"DisplayName:Abp.Ldap.ServerPort": "Sunucu portu",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/vi.json

@ -1,6 +1,8 @@
{
"culture": "vi",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "LDAP qua SSL",
"Description:Abp.Ldap.Ldaps": "LDAP qua SSL",
"DisplayName:Abp.Ldap.ServerHost": "Máy chủ lưu trữ",
"Description:Abp.Ldap.ServerHost": "Máy chủ lưu trữ",
"DisplayName:Abp.Ldap.ServerPort": "Cổng máy chủ",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/zh-Hans.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "基于SSL的LDAP",
"Description:Abp.Ldap.Ldaps": "基于SSL的LDAP",
"DisplayName:Abp.Ldap.ServerHost": "服务器主机",
"Description:Abp.Ldap.ServerHost": "服务器主机",
"DisplayName:Abp.Ldap.ServerPort": "服务器端口",

2
framework/src/Volo.Abp.Ldap.Abstractions/Volo/Abp/Ldap/Localization/zh-Hant.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hant",
"texts": {
"DisplayName:Abp.Ldap.Ldaps": "基於SSL的LDAP",
"Description:Abp.Ldap.Ldaps": "基於SSL的LDAP",
"DisplayName:Abp.Ldap.ServerHost": "服務器主機",
"Description:Abp.Ldap.ServerHost": "服務器主機",
"DisplayName:Abp.Ldap.ServerPort": "服務器端口",

6
framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingDefinitionProvider.cs

@ -9,6 +9,12 @@ public class LdapSettingDefinitionProvider : SettingDefinitionProvider
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
LdapSettingNames.Ldaps,
"false",
L("DisplayName:Abp.Ldap.Ldaps"),
L("Description:Abp.Ldap.Ldaps")),
new SettingDefinition(
LdapSettingNames.ServerHost,
"",

17
framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingProvider.cs

@ -14,32 +14,37 @@ public class LdapSettingProvider : ILdapSettingProvider, ITransientDependency
SettingProvider = settingProvider;
}
public async Task<string?> GetServerHostAsync()
public virtual async Task<bool> GetLdapOverSsl()
{
return (await SettingProvider.GetOrNullAsync(LdapSettingNames.Ldaps))?.To<bool>() ?? default;
}
public virtual async Task<string?> GetServerHostAsync()
{
return await SettingProvider.GetOrNullAsync(LdapSettingNames.ServerHost);
}
public async Task<int> GetServerPortAsync()
public virtual async Task<int> GetServerPortAsync()
{
return (await SettingProvider.GetOrNullAsync(LdapSettingNames.ServerPort))?.To<int>() ?? default;
}
public async Task<string?> GetBaseDcAsync()
public virtual async Task<string?> GetBaseDcAsync()
{
return await SettingProvider.GetOrNullAsync(LdapSettingNames.BaseDc);
}
public async Task<string?> GetDomainAsync()
public virtual async Task<string?> GetDomainAsync()
{
return await SettingProvider.GetOrNullAsync(LdapSettingNames.Domain);
}
public async Task<string?> GetUserNameAsync()
public virtual async Task<string?> GetUserNameAsync()
{
return await SettingProvider.GetOrNullAsync(LdapSettingNames.UserName);
}
public async Task<string?> GetPasswordAsync()
public virtual async Task<string?> GetPasswordAsync()
{
return await SettingProvider.GetOrNullAsync(LdapSettingNames.Password);
}

Loading…
Cancel
Save