Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project updates #19

Merged
merged 5 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Bug Report
description: Create a report to help reproduce and correct the bug
labels: ['Bug', 'Needs Triage']

body:
- type: markdown
attributes:
value: >
#### Before submitting a bug, please make sure the issue hasn't been already
addressed by searching through [the past issues](https://github.com/cloud-py-api/app_ecosystem_v2/issues).
- type: textarea
attributes:
label: Describe the bug
description: >
A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps/Code to Reproduce
description: |
Please add a minimal code example that can reproduce the error when running it. Be as succinct as possible.

If the code is too long, feel free to put it in a public gist and link it in the issue: https://gist.github.com.

placeholder: |
```
Sample code to reproduce the problem
```
validations:
required: true
- type: textarea
attributes:
label: Expected Results
description: >
Please paste or describe the expected results.
placeholder: >
Example: No error is thrown.
validations:
required: true
- type: textarea
attributes:
label: Actual Results
description: |
Please paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full traceback** of the exception.
placeholder: >
Please paste or specifically describe the actual output or traceback.
validations:
required: true
- type: textarea
attributes:
label: Setup configuration
description: |
Paste or describe the configuration setting, including software versions, to help diagnose the problem more quickly.
placeholder: >
Example: app_ecosystem_v2 = 1.0.0, nextcloud = 28.0.4, etc.
validations:
required: true
- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Discussions
url: https://github.com/cloud-py-api/app_ecosystem_v2/discussions/new
about: Ask questions and discuss
- name: Blank issue
url: https://github.com/cloud-py-api/app_ecosystem_v2/issues/new
about: Please note that Github Discussions should be used in most cases instead
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Feature request
description: Suggest a new feature, enhancement to an existing, etc.
labels: ['New Feature', 'Needs Triage']

body:
- type: textarea
attributes:
label: Describe why it is important and where it will be useful
validations:
required: true
- type: textarea
attributes:
label: Describe your proposed solution
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered, if relevant
- type: textarea
attributes:
label: Additional context
File renamed without changes.
3 changes: 0 additions & 3 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
/.pre-commit-config.yaml
/babel.config.js
/build
/AUTHORS.md
/CHANGELOG.md
/CODE_OF_CONDUCT.md
/README.md
/SECURITY.md
/composer.*
/node_modules
/screenshots
Expand Down
11 changes: 9 additions & 2 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Authors

* Andrey Borysenko <andrey18106x@gmail.com> (Developer)
* Alexander Piskun <bigcat88@icloud.com> (Developer)
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:

* Andrey Borysenko <andrey18106x@gmail.com>
* Alexander Piskun <bigcat88@icloud.com>
* Julien Veyssier <julien-nc@posteo.net>

[//]: # (<Please alphabetize new entries>)
5 changes: 5 additions & 0 deletions LICENSE-README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Files in the AppEcosystemV2 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.
74 changes: 19 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,31 @@

# Nextcloud App Ecosystem V2

Nextcloud App Ecosystem V2 provides a new API for external apps on different programming languages
Nextcloud AppEcosystemV2 provides an API over existing Nextcloud APIs for external apps (ExApp)
on different programming languages.
It also brings out a new way to develop apps for Nextcloud with separate security layer ([AppEcosystemAuth](https://cloud-py-api.github.io/app_ecosystem_v2/authentication.html)),
that supports scopes.

| Currently in a prototyping stage
| For now there is only one official [Python library](https://github.com/cloud-py-api/nc_py_api).

Docs can be found [here](https://cloud-py-api.github.io/app_ecosystem_v2/).
## Documentation

## Dev changes to Nextcloud
Documentation can be found [here](https://cloud-py-api.github.io/app_ecosystem_v2/).

`base.php` adjustment for authentication of Ex apps ([patch](./base_php.patch)).
## ExApps list

```php
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;
}
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
return $appEcosystemV2Service->validateExAppRequestToNC($request);
}
Here is a list of the Nextcloud ExApps, using AppEcosystemV2.

```
`base.php - handleLogin`
| 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) |
| app_python_skeleton | Python | skeleton | Skeleton for Python ExApp | [GitHub](https://github.com/cloud-py-api/app_python_skeleton) |

```php
if (self::tryAppEcosystemV2Login($request)) {
return true;
}
```
### Support

## Authentication diagram
We appreciate any support for this project:

AppEcosystemV2 adds separate authentication for external apps.
This authentication is based on a shared secret between Nextcloud and the external app.

### Overview of the authentication process

1. ExApp sends a request to Nextcloud
2. Nextcloud passes request to AppEcosystemV2
3. AppEcosystemV2 validates request
4. Request is accepted/rejected

```mermaid
sequenceDiagram
participant ExApp
box Nextcloud
participant Nextcloud
participant AppEcosystemV2
end
ExApp->>+Nextcloud: Request to API
Nextcloud->>+AppEcosystemV2: Validate request
AppEcosystemV2-->>-Nextcloud: Request accepted/rejected
Nextcloud-->>-ExApp: Response (200/401)
```

More details in [docs](https://cloud-py-api.github.io/app_ecosystem_v2/authentication.html)

## 🔧 Configuration

### Admin settings

In Admin section you can configure existing external apps.
- ⭐ Star our work on GitHub (it helps us a lot)
- ❗ Create an Issue or feature request (bring to us an excellent idea)
- 💁 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)
10 changes: 5 additions & 5 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
// ExApps
['name' => 'exApp#getExApps', 'url' => '/api/v1/ex-app/all', 'verb' => 'GET'],

// Ex Apps registration
['name' => 'OCSApi#registerExternalApp', 'url' => '/api/v1/ex-app', 'verb' => 'POST'],
['name' => 'OCSApi#unregisterExternalApp', 'url' => '/api/v1/ex-app', 'verb' => 'DELETE'],
['name' => 'OCSApi#getAppStatus', 'url' => '/api/v1/ex-app/{appId}/status', 'verb' => 'GET'],
// Ex Apps registration (for Admin GUI, not implemented yet)
// ['name' => 'OCSApi#registerExternalApp', 'url' => '/api/v1/ex-app', 'verb' => 'POST'],
// ['name' => 'OCSApi#unregisterExternalApp', 'url' => '/api/v1/ex-app', 'verb' => 'DELETE'],
// ['name' => 'OCSApi#getAppStatus', 'url' => '/api/v1/ex-app/{appId}/status', 'verb' => 'GET'],

// File Actions Menu
['name' => 'OCSApi#registerFileActionMenu', 'url' => '/api/v1/files/actions/menu', 'verb' => 'POST'],
Expand All @@ -71,7 +71,7 @@
// TODO: Implement Notifications, SearchProvider, BackgroundJob, SettingsPage, SettingsSection, EventListener, DashboardWidget, Capabilities

// Notifications
// ['name' => 'notification#sendNotification', 'url' => '/api/v1/notification', 'verb' => 'POST'],
['name' => 'notifications#sendNotification', 'url' => '/api/v1/notification', 'verb' => 'POST'],
// ['name' => 'notification#registerNotificationProvider', 'url' => '/api/v1/notification-provider', 'verb' => 'POST'],
// ['name' => 'notification#unregisterNotificationProvider', 'url' => '/api/v1/notification-provider', 'verb' => 'DELETE'],

Expand Down
5 changes: 5 additions & 0 deletions docs/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ Authentication flow in details
Nextcloud->>-ExApp: Response (200/401)


AppEcosystemAuth
^^^^^^^^^^^^^^^^

AppEcosystemV2 provides ``AppEcosystemAuth`` attribute with a middleware to validate requests from ExApps.
In PHP API controllers you can use it as attribute or annotation (for NC26).
Loading