forked from nextcloud/app_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base_php.patch
72 lines (65 loc) · 2.13 KB
/
base_php.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 1ed62d007ce19934edf71740099665e661fbb368 Mon Sep 17 00:00:00 2001
From: Andrey Borysenko <[email protected]>
Date: Tue, 27 Jun 2023 15:05:52 +0300
Subject: [PATCH 1/2] Added app_ecosystem_v2 auth to base.php
---
lib/base.php | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lib/base.php b/lib/base.php
index 09ec5be441b5..b49491e61b02 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -1133,6 +1133,9 @@ public static function handleLogin(OCP\IRequest $request): bool {
if (OC_User::handleApacheAuth()) {
return true;
}
+ if (self::tryAppEcosystemV2Login($request)) {
+ return true;
+ }
if ($userSession->tryTokenLogin($request)) {
return true;
}
@@ -1170,6 +1173,21 @@ protected static function handleAuthHeaders(): void {
}
}
}
+
+ protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
+ $appManager = Server::get(OCP\App\IAppManager::class);
+ if (!$request->getHeader('AE-SIGNATURE')) {
+ return false;
+ }
+ if (!$appManager->isAppLoaded('app_ecosystem_v2')) {
+ return false;
+ }
+ if (!$appManager->isInstalled('app_ecosystem_v2')) {
+ return false;
+ }
+ $appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
+ return $appEcosystemV2Service->validateExAppRequestToNC($request);
+ }
}
OC::init();
From b8f1a58f7daf2ade87f2600d37b1926fdfbd949a Mon Sep 17 00:00:00 2001
From: Alexander Piskun <[email protected]>
Date: Thu, 13 Jul 2023 14:17:29 +0300
Subject: [PATCH 2/2] Update base.php
Support 26 Nextcloud
Signed-off-by: Alexander Piskun <[email protected]>
---
lib/base.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/base.php b/lib/base.php
index b49491e61b02..27556a10acc3 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -1179,9 +1179,6 @@ protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
if (!$request->getHeader('AE-SIGNATURE')) {
return false;
}
- if (!$appManager->isAppLoaded('app_ecosystem_v2')) {
- return false;
- }
if (!$appManager->isInstalled('app_ecosystem_v2')) {
return false;
}