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
+14 -2
View File
@@ -365,7 +365,7 @@
NSString *usersUrl;
usersUrl = [NSString stringWithFormat: @"%@%@/",
[[WOApplication application] davURLAsString], [SOGoUser getEncryptedUsernameIfNeeded: owner withContext: context]];
[[WOApplication application] davURLAsString], owner];
ownerHREF = davElementWithContent (@"href", XMLNS_WEBDAV, usersUrl);
return [davElementWithContent (@"owner", XMLNS_WEBDAV, ownerHREF)
@@ -946,6 +946,7 @@
NSMutableArray *path;
NSString *baseURL, *urlMethod, *fullHost;
NSNumber *port;
int i;
serverURL = [context serverURL];
baseURL = [[self baseURLInContext: context] stringByUnescapingURL];
@@ -973,6 +974,17 @@
else
fullHost = [serverURL host];
for (i = 0 ; i < [path count] ; i++) {
// For DAV url, the username must be decrypted
// Username is placed afted dav in url components
if ([[[path objectAtIndex: i] lowercaseString] isEqualToString:@"dav"]) {
if ([path count] > (i + 1)) {
[path replaceObjectAtIndex: (i +1)
withObject: [SOGoUser getDecryptedUsernameIfNeeded: [path objectAtIndex: (i + 1)]]];
}
}
}
url = [[NSURL alloc] initWithScheme: [serverURL scheme]
host: fullHost
path: [path componentsJoinedByString: @"/"]];
@@ -1227,7 +1239,7 @@
davCurrentUserPrincipal = nil;
else
{
s = [NSString stringWithFormat: @"/SOGo/dav/%@", [SOGoUser getEncryptedUsernameIfNeeded:login withContext:[self context]]];
s = [NSString stringWithFormat: @"/SOGo/dav/%@", login];
userHREF = davElementWithContent (@"href", XMLNS_WEBDAV, s);
davCurrentUserPrincipal
= [davElementWithContent (@"current-user-principal",