Skip to content

Commit

Permalink
Fixes after renaming (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Borysenko <[email protected]>
  • Loading branch information
andrey18106 authored Sep 13, 2023
1 parent 9c68821 commit 125bf54
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 149 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
people who have submitted patches, reported bugs, added translations, helped
answer newbie questions, and generally made AppEcosystemV2 that much better:
answer newbie questions, and generally made AppAPI that much better:

* Andrey Borysenko <[email protected]>
* Alexander Piskun <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions LICENSE-README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Files in the AppEcosystemV2 are licensed under the Affero General Public License version 3,
Files in the AppAPI are licensed under the Affero General Public License version 3,
the text of which can be found in LICENSE, or any later version of the AGPL,
unless otherwise noted.

Attribution information for AppEcosystemV2 is contained in the AUTHORS.md file.
Attribution information for AppAPI is contained in the AUTHORS.md file.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Nextcloud AppAPI

[![Tests - Deploy](https://github.com/cloud-py-api/app_ecosystem_v2/actions/workflows/tests-deploy.yml/badge.svg)](https://github.com/cloud-py-api/app_ecosystem_v2/actions/workflows/tests-deploy.yml)
[![Tests](https://github.com/cloud-py-api/app_ecosystem_v2/actions/workflows/tests.yml/badge.svg)](https://github.com/cloud-py-api/app_ecosystem_v2/actions/workflows/tests.yml)
[![Docs](https://github.com/cloud-py-api/app_ecosystem_v2/actions/workflows/docs.yml/badge.svg)](https://cloud-py-api.github.io/app_ecosystem_v2/)
[![Tests - Deploy](https://github.com/cloud-py-api/app_api/actions/workflows/tests-deploy.yml/badge.svg)](https://github.com/cloud-py-api/app_api/actions/workflows/tests-deploy.yml)
[![Tests](https://github.com/cloud-py-api/app_api/actions/workflows/tests.yml/badge.svg)](https://github.com/cloud-py-api/app_api/actions/workflows/tests.yml)
[![Docs](https://github.com/cloud-py-api/app_api/actions/workflows/docs.yml/badge.svg)](https://cloud-py-api.github.io/app_api/)


The App Ecosystem Project is an exciting initiative that aims to revolutionize the way applications are developed for Nextcloud.
The AppAPI Project is an exciting initiative that aims to revolutionize the way applications are developed for Nextcloud.

Unlike the traditional approach that limits developers to using PHP, this innovative ecosystem empowers them
to create applications using a variety of programming languages, opening up a world of possibilities.
Expand Down Expand Up @@ -48,30 +48,30 @@ _If you wish to develop a library for any other language, such as **Go**, **Ruby

## Documentation

- [Documentation](https://cloud-py-api.github.io/app_ecosystem_v2/)
- [Installation](https://cloud-py-api.github.io/app_ecosystem_v2/Installation.html)
- [Creation of Deploy Daemon](https://cloud-py-api.github.io/app_ecosystem_v2/ManagingExternalApplications.html)
- [Managing External Applications](https://cloud-py-api.github.io/app_ecosystem_v2/CreationOfDeployDaemon.html)
- [Technical Details](https://cloud-py-api.github.io/app_ecosystem_v2/tech_details/index.html)
- [Concepts](https://cloud-py-api.github.io/app_ecosystem_v2/Concepts.html)
- [Api Scopes](https://cloud-py-api.github.io/app_ecosystem_v2/tech_details/ApiScopes.html)
- [AppEcosystemV2 APIs](https://cloud-py-api.github.io/app_ecosystem_v2/tech_details/api/index.html)
- [Authentication](https://cloud-py-api.github.io/app_ecosystem_v2/tech_details/Authentication.html)
- [Deployment](https://cloud-py-api.github.io/app_ecosystem_v2/tech_details/Deployment.html)
- [Contribute](https://github.com/cloud-py-api/app_ecosystem_v2/blob/main/.github/CONTRIBUTING.md)
- [Discussions](https://github.com/cloud-py-api/app_ecosystem_v2/discussions)
- [Issues](https://github.com/cloud-py-api/app_ecosystem_v2/issues)
- [Setting up dev environment](https://cloud-py-api.github.io/app_ecosystem_v2/DevSetup.html)
- [Changelog](https://github.com/cloud-py-api/app_ecosystem_v2/blob/main/CHANGELOG.md)
- [Documentation](https://cloud-py-api.github.io/app_api/)
- [Installation](https://cloud-py-api.github.io/app_api/Installation.html)
- [Creation of Deploy Daemon](https://cloud-py-api.github.io/app_api/ManagingExternalApplications.html)
- [Managing External Applications](https://cloud-py-api.github.io/app_api/CreationOfDeployDaemon.html)
- [Technical Details](https://cloud-py-api.github.io/app_api/tech_details/index.html)
- [Concepts](https://cloud-py-api.github.io/app_api/Concepts.html)
- [Api Scopes](https://cloud-py-api.github.io/app_api/tech_details/ApiScopes.html)
- [AppAPI Nextcloud APIs](https://cloud-py-api.github.io/app_api/tech_details/api/index.html)
- [Authentication](https://cloud-py-api.github.io/app_api/tech_details/Authentication.html)
- [Deployment](https://cloud-py-api.github.io/app_api/tech_details/Deployment.html)
- [Contribute](https://github.com/cloud-py-api/app_api/blob/main/.github/CONTRIBUTING.md)
- [Discussions](https://github.com/cloud-py-api/app_api/discussions)
- [Issues](https://github.com/cloud-py-api/app_api/issues)
- [Setting up dev environment](https://cloud-py-api.github.io/app_api/DevSetup.html)
- [Changelog](https://github.com/cloud-py-api/app_api/blob/main/CHANGELOG.md)

## ExApps list

Here is a list of the Nextcloud ExApps, using AppEcosystemV2:
Here is a list of the Nextcloud ExApps, using AppAPI:

| Name | Language | Type | Description | Link |
|---------------|----------|-------------|---------------------------------------------|---------------------------------------------------------|
| nc_py_api | Python | library | Python library for Nextcloud AppEcosystemV2 | [GitHub](https://github.com/cloud-py-api/nc_py_api) |
| upscaler_demo | Python | application | Image UpScaler demonstration | [GitHub](https://github.com/cloud-py-api/upscaler_demo) |
| Name | Language | Type | Description | Link |
|---------------|----------|-------------|-------------------------------------|---------------------------------------------------------|
| nc_py_api | Python | library | Python library for Nextcloud AppAPI | [GitHub](https://github.com/cloud-py-api/nc_py_api) |
| upscaler_demo | Python | application | Image UpScaler demonstration | [GitHub](https://github.com/cloud-py-api/upscaler_demo) |

### Support

Expand All @@ -82,7 +82,7 @@ We appreciate any support for this project:
- 💁 Resolve an Issue and create a Pull Request (contribute to this project)
- 🧑‍💻 Develop your own ExApp and share it to world (it will be listed above)

In closing, we are genuinely excited about the future of the AppEcosystem Project and the potential
In closing, we are genuinely excited about the future of the AppAPI Project and the potential
it holds for transforming the way applications are developed and experienced within Nextcloud.

As we embark on this journey, we extend our warmest invitation to you — developers, thinkers, creators, and
Expand Down
4 changes: 2 additions & 2 deletions docs/DeployConfigurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Benefit: no performance impact on Nextcloud host.
class ExApp2 python
class ExApp3 python

In this case, the AppEcosystem (Nextcloud) uses ``port`` to interact with Docker.
In this case, the AppAPI (Nextcloud) uses ``port`` to interact with Docker.

NC & ExApps in the same Docker
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -175,7 +175,7 @@ In this scenario, Nextcloud is installed within a container, and a separate Daem
class ExApp2 python
class ExApp3 python

In this case, the AppEcosystem (Nextcloud) uses ``socket`` to interact with Docker.
In this case, the AppAPI (Nextcloud) uses ``socket`` to interact with Docker.

Nextcloud in Docker AIO (all-in-one)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/DevSetup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Assuming you're in the ``apps`` folder of Nextcloud with command :command:`git`:

Move to the ``app_api`` directory with :command:`shell`::

cd app_ecosystem_v2
cd app_api

Then, build NPM and JS with :command:`shell`::

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
]

# General information about the project.
project = "AppEcosystemV2"
project = "AppAPI"
copyright = str(now.year) + " Nextcloud GmbH" # noqa

# The version info for the project you're documenting, acts as replacement for
Expand Down
38 changes: 19 additions & 19 deletions docs/tech_details/Authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Authentication flow

1. ExApp sends a request to Nextcloud
2. Nextcloud passes request to AppAPI
3. AppApi validates request (see `authentication flow in details`_)
3. AppAPI validates request (see `authentication flow in details`_)
4. Request is accepted/rejected

.. mermaid::
Expand Down Expand Up @@ -47,32 +47,32 @@ Authentication flow in details
participant ExApp
box Nextcloud
participant Nextcloud
participant AppApi
participant AppAPI
end
ExApp->>+Nextcloud: Request to API
Nextcloud->>Nextcloud: Check if AUTHORIZATION-APP-API header exists
Nextcloud-->>ExApp: Reject if AUTHORIZATION-APP-API header not exists
Nextcloud->>Nextcloud: Check if AppApi app is enabled
Nextcloud-->>ExApp: Reject if AppApi is not exists or disabled
Nextcloud->>+AppApi: Validate request
AppApi-->>AppApi: Check if ExApp exists and enabled
AppApi-->>Nextcloud: Reject if ExApp not exists or disabled
AppApi-->>AppApi: Check if ExApp version changed
AppApi-->>Nextcloud: Disable ExApp and notify admins if version changed
AppApi-->>AppApi: Validate shared secret from AUTHORIZATION-APP-API
AppApi-->>Nextcloud: Reject if secret does not match
AppApi-->>AppApi: Check API scope
AppApi-->>Nextcloud: Reject if API scope not match
AppApi-->>AppApi: Check if user interacted with ExApp
AppApi-->>Nextcloud: Reject if user has not interacted with ExApp (attempt to bypass user)
AppApi-->>AppApi: Check if user is not empty and active
AppApi-->>Nextcloud: Set active user
AppApi->>-Nextcloud: Request accepted/rejected
Nextcloud->>Nextcloud: Check if AppAPI app is enabled
Nextcloud-->>ExApp: Reject if AppAPI is not exists or disabled
Nextcloud->>+AppAPI: Validate request
AppAPI-->>AppAPI: Check if ExApp exists and enabled
AppAPI-->>Nextcloud: Reject if ExApp not exists or disabled
AppAPI-->>AppAPI: Check if ExApp version changed
AppAPI-->>Nextcloud: Disable ExApp and notify admins if version changed
AppAPI-->>AppAPI: Validate shared secret from AUTHORIZATION-APP-API
AppAPI-->>Nextcloud: Reject if secret does not match
AppAPI-->>AppAPI: Check API scope
AppAPI-->>Nextcloud: Reject if API scope not match
AppAPI-->>AppAPI: Check if user interacted with ExApp
AppAPI-->>Nextcloud: Reject if user has not interacted with ExApp (attempt to bypass user)
AppAPI-->>AppAPI: Check if user is not empty and active
AppAPI-->>Nextcloud: Set active user
AppAPI->>-Nextcloud: Request accepted/rejected
Nextcloud->>-ExApp: Response (200/401)


AppAPIAuth
^^^^^^^^^^

AppApi provides ``AppAPIAuth`` attribute with middleware to validate requests from ExApps.
AppAPI provides ``AppAPIAuth`` attribute with middleware to validate requests from ExApps.
In your API controllers you can use it as an PHP attribute.
8 changes: 4 additions & 4 deletions docs/tech_details/Deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Deployment
Overview
--------

AppEcosystemV2 ExApps deployment process in short consists of 3 steps:
AppAPI ExApps deployment process in short consists of 3 steps:

1. `DaemonConfig registration`_
2. `ExApp deployment`_
Expand Down Expand Up @@ -157,14 +157,14 @@ Deploy env variables
Deploy env variables are used to configure ExApp container.
The following env variables are required and built automatically:

* ``AE_VERSION`` - AppEcosystemV2 version
* ``APP_SECRET`` - generated shared secret used for AppEcosystemV2 authentication
* ``AA_VERSION`` - AppAPI version
* ``APP_SECRET`` - generated shared secret used for AppAPI authentication
* ``APP_ID`` - ExApp appid
* ``APP_DISPLAY_NAME`` - ExApp display name
* ``APP_VERSION`` - ExApp version
* ``APP_PROTOCOL`` - protocol ExApp is listening on (http|https)
* ``APP_HOST`` - host ExApp is listening on
* ``APP_PORT`` - port ExApp is listening on (randomly selected by AppEcosystemV2)
* ``APP_PORT`` - port ExApp is listening on (randomly selected by AppAPI)
* ``IS_SYSTEM_APP`` - ExApp system app flag (true|false)
* ``NEXTCLOUD_URL`` - Nextcloud URL to connect to

Expand Down
2 changes: 1 addition & 1 deletion lib/Attribute/AppAPIAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace OCA\AppApi\Attribute;
namespace OCA\AppAPI\Attribute;

use Attribute;

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/DaemonConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class DaemonConfig
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAcceptsDeployId()
* @method string getName()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExApp
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAppid()
* @method string getVersion()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExAppApiScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExAppApiScope
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getApiRoute()
* @method int getScopeGroup()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExAppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExAppConfig
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAppid()
* @method string getConfigkey()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExAppPreference.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExAppPreference
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getUserid()
* @method string getAppid()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExAppScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExAppScope
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAppid()
* @method int getScopeGroup()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExAppUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExAppUser
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAppid()
* @method string getUserid()
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ExFilesActionsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Class ExFilesActionsMenu
*
* @package OCA\AppApi\Db
* @package OCA\AppAPI\Db
*
* @method string getAppid()
* @method string getName()
Expand Down
4 changes: 2 additions & 2 deletions lib/DeployActions/DockerActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class DockerActions implements IDeployActions {
public const DOCKER_API_VERSION = 'v1.41';
public const AE_REQUIRED_ENVS = [
'AE_VERSION',
'AA_VERSION',
'APP_SECRET',
'APP_ID',
'APP_DISPLAY_NAME',
Expand Down Expand Up @@ -388,7 +388,7 @@ private function extractDeployEnvs(array $envs): array {

public function buildDeployEnvs(array $params, array $envOptions, array $deployConfig): array {
$autoEnvs = [
sprintf('AE_VERSION=%s', $this->appManager->getAppVersion(Application::APP_ID, false)),
sprintf('AA_VERSION=%s', $this->appManager->getAppVersion(Application::APP_ID, false)),
sprintf('APP_SECRET=%s', $params['secret']),
sprintf('APP_ID=%s', $params['appid']),
sprintf('APP_DISPLAY_NAME=%s', $params['name']),
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/TalkBotsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace OCA\AppApi\Service;
namespace OCA\AppAPI\Service;

use OCA\AppApi\Db\ExApp;
use OCA\AppAPI\Db\ExApp;
use OCA\Talk\Events\BotInstallEvent;
use OCA\Talk\Events\BotUninstallEvent;
use OCP\EventDispatcher\IEventDispatcher;
Expand Down
Loading

0 comments on commit 125bf54

Please sign in to comment.