Browse Source

new name of AppEcosystem is AppAPI

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
tags/v28.0.0beta1
Alexander Piskun 8 months ago
parent
commit
01a11641f4
3 changed files with 9 additions and 9 deletions
  1. 2
    2
      build/stubs/app_api.php
  2. 6
    6
      lib/base.php
  3. 1
    1
      psalm.xml

build/stubs/app_ecosystem_v2.php → build/stubs/app_api.php View File

<?php <?php


namespace OCA\AppEcosystemV2\Service;
namespace OCA\AppAPI\Service;


use OCP\IRequest; use OCP\IRequest;


class AppEcosystemV2Service {
class AppAPIService {
/** /**
* @param IRequest $request * @param IRequest $request
* @param bool $isDav * @param bool $isDav

+ 6
- 6
lib/base.php View File

if (OC_User::handleApacheAuth()) { if (OC_User::handleApacheAuth()) {
return true; return true;
} }
if (self::tryAppEcosystemV2Login($request)) {
if (self::tryAppAPILogin($request)) {
return true; return true;
} }
if ($userSession->tryTokenLogin($request)) { if ($userSession->tryTokenLogin($request)) {
} }
} }


protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
protected static function tryAppAPILogin(OCP\IRequest $request): bool {
$appManager = Server::get(OCP\App\IAppManager::class); $appManager = Server::get(OCP\App\IAppManager::class);
if (!$request->getHeader('AE-SIGNATURE')) {
if (!$request->getHeader('AUTHORIZATION-APP-API')) {
return false; return false;
} }
if (!$appManager->isInstalled('app_ecosystem_v2')) {
if (!$appManager->isInstalled('app_api')) {
return false; return false;
} }
try { 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) { } catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) {
return false; return false;
} }

+ 1
- 1
psalm.xml View File

<file name="build/stubs/zip.php"/> <file name="build/stubs/zip.php"/>
<file name="build/stubs/psr_container.php"/> <file name="build/stubs/psr_container.php"/>
<file name="3rdparty/sabre/uri/lib/functions.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> </stubs>
<issueHandlers> <issueHandlers>
<LessSpecificReturnStatement errorLevel="error"/> <LessSpecificReturnStatement errorLevel="error"/>

Loading…
Cancel
Save