mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #39655 from nextcloud/appecosystem-auth
AppEcosystem Authentification
This commit is contained in:
commit
a38a86e5c4
3 changed files with 35 additions and 0 deletions
15
build/stubs/app_ecosystem_v2.php
Normal file
15
build/stubs/app_ecosystem_v2.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\AppEcosystemV2\Service;
|
||||
|
||||
use OCP\IRequest;
|
||||
|
||||
class AppEcosystemV2Service {
|
||||
/**
|
||||
* @param IRequest $request
|
||||
* @param bool $isDav
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validateExAppRequestToNC(IRequest $request, bool $isDav = false): bool {}
|
||||
}
|
||||
19
lib/base.php
19
lib/base.php
|
|
@ -1137,6 +1137,9 @@ class OC {
|
|||
if (OC_User::handleApacheAuth()) {
|
||||
return true;
|
||||
}
|
||||
if (self::tryAppEcosystemV2Login($request)) {
|
||||
return true;
|
||||
}
|
||||
if ($userSession->tryTokenLogin($request)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1174,6 +1177,22 @@ class OC {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
|
||||
$appManager = Server::get(OCP\App\IAppManager::class);
|
||||
if (!$request->getHeader('AE-SIGNATURE')) {
|
||||
return false;
|
||||
}
|
||||
if (!$appManager->isInstalled('app_ecosystem_v2')) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
|
||||
return $appEcosystemV2Service->validateExAppRequestToNC($request);
|
||||
} catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OC::init();
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@
|
|||
<file name="build/stubs/zip.php"/>
|
||||
<file name="build/stubs/psr_container.php"/>
|
||||
<file name="3rdparty/sabre/uri/lib/functions.php" />
|
||||
<file name="build/stubs/app_ecosystem_v2.php" />
|
||||
</stubs>
|
||||
<issueHandlers>
|
||||
<LessSpecificReturnStatement errorLevel="error"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue