hi
What's your project theme? Lepton or Lepton X?
What is the recommended approach to allow for the connection string to be encrypted when adding/saving a tenant. Additionally what would need to be overridden/replaced in order for the framework to be able to decrypt the connection string when working with a tenant?
hi
These methods of ITenantAppService are used to add/update ConnectionStrings.
public interface ITenantAppService
{
//...
Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input);
Task<SaasTenantConnectionStringsDto> GetConnectionStringsAsync(Guid id);
Task UpdateConnectionStringsAsync(Guid id, SaasTenantConnectionStringsDto input);
//...
}
MultiTenantConnectionStringResolver is used to get ConnectionStrings.
You can try to override the above services.
hi
For Volo.Abp.Gdpr:010001
You can change the RequestTimeInterval of AbpGdprOptions
RequestTimeInterval (default: 1 day): It uses to indicate the allowed request time interval. You can configure this property if you want to increase or decrease the personal data request interval. By default, users can request their personal data once a day.
https://docs.abp.io/en/commercial/latest/modules/gdpr#abpgdproptions
hi
I will share a solution.
hi
Please output stdout to troubleshoot the problem.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/logging-and-diagnostics?view=aspnetcore-7.0
hi
Please share these projects, liming.ma@volosoft.com
I will check it on my local
hi
Please add the below code to your project and reproduce the problem and share the Logs.txt
[Authorize]
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(MyGdprRequestAppService), typeof(IGdprRequestAppService), typeof(GdprRequestAppService))]
public class MyGdprRequestAppService : GdprRequestAppService
{
public MyGdprRequestAppService(
IGdprRequestRepository gdprRequestRepository,
IDistributedEventBus eventBus,
IOptions<AbpGdprOptions> gdprOptions,
IDistributedCache<DownloadTokenCacheItem, string> downloadTokenCache) :
base(gdprRequestRepository, eventBus, gdprOptions, downloadTokenCache)
{
}
public async override Task PrepareUserDataAsync()
{
var latestRequestTime = await GdprRequestRepository.FindLatestRequestTimeOfUserAsync(CurrentUser.GetId());
var isNewRequestAllowedInternal = latestRequestTime.HasValue && Clock.Now - latestRequestTime > GdprOptions.RequestTimeInterval;
if (!isNewRequestAllowedInternal)
{
Logger.LogError($"Clock.Now: {Clock.Now} - latestRequestTime: {latestRequestTime} - RequestTimeInterval: {GdprOptions.RequestTimeInterval}");
throw new BusinessException(GdprErrorCodes.NotAllowedForRequest);
}
var gdprRequest = new GdprRequest(GuidGenerator.Create(), CurrentUser.GetId(), Clock.Now.AddMinutes(GdprOptions.MinutesForDataPreparation));
await GdprRequestRepository.InsertAsync(gdprRequest);
await EventBus.PublishAsync(new GdprUserDataRequestedEto
{
UserId = CurrentUser.GetId(),
RequestId = gdprRequest.Id
}
);
}
[AllowAnonymous]
public async override Task<IRemoteStreamContent> GetUserDataAsync(Guid id, string token)
{
var downloadToken = await DownloadTokenCache.GetAsync(token);
if (downloadToken == null || downloadToken.RequestId != id)
{
throw new AbpAuthorizationException();
}
await DownloadTokenCache.RemoveAsync(token);
var request = await GdprRequestRepository.GetAsync(id, true);
if (Clock.Now < request.ReadyTime)
{
Logger.LogError($"Clock.Now: {Clock.Now} - ReadyTime: {request.ReadyTime}");
throw new BusinessException(GdprErrorCodes.DataNotPreparedYet)
.WithData("GdprDataReadyTime", request.ReadyTime.ToShortTimeString());
}
using (var memoryStream = new MemoryStream())
{
using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
{
var infos = request.Infos;
foreach (var info in infos)
{
var file = archive.CreateEntry(GuidGenerator.Create() + ".json", CompressionLevel.Fastest);
using (var entry = file.Open())
{
var byteArr = Encoding.UTF8.GetBytes(info.Data);
await entry.WriteAsync(byteArr, 0, byteArr.Length);
}
}
}
memoryStream.Seek(0, SeekOrigin.Begin);
var ms = new MemoryStream();
await memoryStream.CopyToAsync(ms);
ms.Seek(0, SeekOrigin.Begin);
return new RemoteStreamContent(ms, "PersonalData.zip", "application/zip");
}
}
}
This seems to be a problem with the Clock or time zone. Do you have any relevant changes?
hi
Please share an online URL I will test it. Please share the full logs(Logs.txt)
liming.ma@volosoft.com