feat(core): Add URL encryption for GDPR compliancy. Remove dav encryption

This commit is contained in:
smizrahi
2024-01-02 13:46:46 +01:00
parent 10d789fb1f
commit 2748d1dd08
11 changed files with 30 additions and 46 deletions
+4 -9
View File
@@ -1201,25 +1201,22 @@ static const NSString *kEncryptedUserNamePrefix = @"uenc";
}
/* Encryption */
+ (NSString *) getEncryptedUsernameIfNeeded:(NSString *)username withContext:(WOContext *)context
+ (NSString *) getEncryptedUsernameIfNeeded:(NSString *)username
{
NSException *exception;
NSString *tmp, *cacheKey;
SOGoCache *cache;
WORequest *request;
if (![[SOGoSystemDefaults sharedSystemDefaults] isURLEncryptionEnabled])
return username;
request = [context request];
cache = [SOGoCache sharedCache];
cacheKey = [NSString stringWithFormat: @"%@_%@_%@", kEncryptedUserNamePrefix, username, [request requestHandlerKey]];
cacheKey = [NSString stringWithFormat: @"%@_%@", kEncryptedUserNamePrefix, username];
exception = nil;
tmp = nil;
tmp = [cache valueForKey: cacheKey];
NSLog(@"DKEY %@ - %@", cacheKey, tmp);
if (tmp) {
return tmp;
} else {
@@ -1239,19 +1236,17 @@ static const NSString *kEncryptedUserNamePrefix = @"uenc";
}
}
+ (NSString *) getDecryptedUsernameIfNeeded:(NSString *)username withContext:(WOContext *)context
+ (NSString *) getDecryptedUsernameIfNeeded:(NSString *)username
{
NSException *exception;
NSString *tmp, *cacheKey;
SOGoCache *cache;
WORequest *request;
if (![[SOGoSystemDefaults sharedSystemDefaults] isURLEncryptionEnabled])
return username;
request = [context request];
cache = [SOGoCache sharedCache];
cacheKey = [NSString stringWithFormat: @"%@_%@_%@", kEncryptedUserNamePrefix, username, [request requestHandlerKey]];
cacheKey = [NSString stringWithFormat: @"%@_%@", kEncryptedUserNamePrefix, username];
exception = nil;
tmp = nil;