-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docker-daemon-security-notes
- Loading branch information
Showing
13 changed files
with
237 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ to join us in shaping a more versatile, stable, and secure app landscape. | |
*Your insights, suggestions, and contributions are invaluable to us.* | ||
]]></description> | ||
<version>1.1.0</version> | ||
<version>1.2.2</version> | ||
<licence>agpl</licence> | ||
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author> | ||
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
.. _app_installation_flow: | ||
|
||
App Installation Flow | ||
===================== | ||
|
||
Heartbeat | ||
--------- | ||
|
||
The first thing AppAPI does is deploy of the application. | ||
|
||
In the case of ``Docker``, this is: | ||
|
||
#. 1. performing an image pull | ||
#. 2. creating container from the docker image | ||
#. 3. waiting until the “/heartbeat” endpoint becomes available with a ``GET`` request. | ||
|
||
The application, in response to the request "/heartbeat", should return json: ``{"status": "ok"}``. | ||
|
||
.. note:: The request to ``/heartbeat`` endpoint is made without AppAPI authentication. | ||
|
||
Init | ||
---- | ||
|
||
After application is ready, which is determined by previous step, | ||
AppAPI sends ``POST`` request to the ``/init`` application endpoint. | ||
|
||
*Application should response with empty JSON, if initialization takes long time it should be done in background and not in this request handler.* | ||
|
||
.. note:: Starting from this point, all requests made by AppAPI contains :ref:`auth-headers`. | ||
|
||
If the application does not need to carry out long initialization, it can immediately execute an ``OCS request`` to | ||
``/ocs/v1.php/apps/app_api/apps/status/$APP_ID`` with such a payload in json format:: | ||
|
||
{"progress": 100} | ||
|
||
If the application initialization takes a long time, the application should periodically send an ``OCS request`` to | ||
``/ocs/v1.php/apps/app_api/apps/status/$APP_ID`` with the progress value. | ||
|
||
Possible values for **progress** are integers from 1 to 100; | ||
after receiving the value 100, the **application is considered initialized and ready to work**. | ||
|
||
If at the initialization stage the application has a critical error due to which its further operation is impossible, | ||
|
||
``"error": "some error"`` | ||
|
||
should be added to the ``OCS request`` for setting progress, | ||
with a short explanation at what stage this error occurred. | ||
|
||
Example of request payload with error will look like this:: | ||
|
||
{"progress": 67, "error": "connection error to huggingface."} | ||
|
||
Enabled | ||
------- | ||
|
||
After receiving **progress: 100**, AppAPI enables the application. | ||
|
||
It is done, by calling ``/enabled`` application endpoint with the ``PUT`` request. | ||
|
||
Payload of the request made by AppAPI to the application contains ``enabled`` value, which is ``True`` for enabling. | ||
|
||
.. note:: ``/enabled`` endpoint shares both **enabling** and **disabling**, | ||
so app should determine what is going on using the ``enabled`` input parameter of the request. | ||
|
||
Inside ``/enabled`` handler application should register all actions related to the Nextcloud, like UI and all other stuff. | ||
|
||
Response for this request should contain:: | ||
|
||
{"error": ""} | ||
|
||
for success and if some error occur during **enabling**, it should be present and not be empty:: | ||
|
||
{"error": "i cant handle enabling"} | ||
|
||
This is all three steps involved in the applications installation flow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ AppAPI Nextcloud APIs | |
fileactionsmenu | ||
notifications | ||
talkbots | ||
other_ocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Other OCS APIs | ||
============== | ||
|
||
With AppAPI authentication it is possible for ExApps to use any other OCS APIs, that doesn't require OCP implementation: | ||
|
||
.. note:: | ||
|
||
To access these APIs they have to be supported by AppAPI (see :ref:`api_scopes`), | ||
and ExApp have to require granted access (in ``info.xml``) to them accordingly. | ||
|
||
1. Calendar | ||
2. Contacts | ||
3. File System & Tags | ||
4. Shares | ||
5. Notifications | ||
6. Users & Groups | ||
7. User & Weather status | ||
8. Activities | ||
9. Notes | ||
10. Etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ Technical details | |
:maxdepth: 2 | ||
|
||
Glossary | ||
InstallationFlow | ||
ApiScopes | ||
Deployment | ||
Authentication | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.