mirror of https://github.com/nextcloud/server
new name of AppEcosystem is AppAPI
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
This commit is contained in:
parent
8ac768c584
commit
01a11641f4
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\AppEcosystemV2\Service;
|
||||
namespace OCA\AppAPI\Service;
|
||||
|
||||
use OCP\IRequest;
|
||||
|
||||
class AppEcosystemV2Service {
|
||||
class AppAPIService {
|
||||
/**
|
||||
* @param IRequest $request
|
||||
* @param bool $isDav
|
12
lib/base.php
12
lib/base.php
|
@ -1138,7 +1138,7 @@ class OC {
|
|||
if (OC_User::handleApacheAuth()) {
|
||||
return true;
|
||||
}
|
||||
if (self::tryAppEcosystemV2Login($request)) {
|
||||
if (self::tryAppAPILogin($request)) {
|
||||
return true;
|
||||
}
|
||||
if ($userSession->tryTokenLogin($request)) {
|
||||
|
@ -1179,17 +1179,17 @@ class OC {
|
|||
}
|
||||
}
|
||||
|
||||
protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
|
||||
protected static function tryAppAPILogin(OCP\IRequest $request): bool {
|
||||
$appManager = Server::get(OCP\App\IAppManager::class);
|
||||
if (!$request->getHeader('AE-SIGNATURE')) {
|
||||
if (!$request->getHeader('AUTHORIZATION-APP-API')) {
|
||||
return false;
|
||||
}
|
||||
if (!$appManager->isInstalled('app_ecosystem_v2')) {
|
||||
if (!$appManager->isInstalled('app_api')) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
|
||||
return $appEcosystemV2Service->validateExAppRequestToNC($request);
|
||||
$appAPIService = Server::get(OCA\AppAPI\Service\AppAPIService::class);
|
||||
return $appAPIService->validateExAppRequestToNC($request);
|
||||
} catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -81,7 +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" />
|
||||
<file name="build/stubs/app_api.php" />
|
||||
</stubs>
|
||||
<issueHandlers>
|
||||
<LessSpecificReturnStatement errorLevel="error"/>
|
||||
|
|
Loading…
Reference in New Issue