-
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.
ExApp routes (public/user/admin) support (#327)
This PR introduces new (mandatory if you use the ExApp proxy) registration of the routes that are allowed to call on ExApp via AppAPI ExApp proxy. --------- Signed-off-by: Andrey Borysenko <[email protected]> Co-authored-by: Alexander Piskun <[email protected]>
- Loading branch information
1 parent
1591de1
commit 65003cd
Showing
13 changed files
with
354 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,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>2.8.0</version> | ||
<version>3.0.0</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 |
---|---|---|
|
@@ -13,6 +13,7 @@ AppAPI Nextcloud APIs | |
appconfig | ||
preferences | ||
exapp | ||
routes | ||
utils | ||
fileactionsmenu | ||
topmenu | ||
|
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,45 @@ | ||
.. _ex_app_routes: | ||
|
||
====== | ||
Routes | ||
====== | ||
|
||
Since AppAPI 3.0.0 ExApps have to declare their routes allowed to be accessed via the AppAPI ExApp proxy. | ||
|
||
.. note:: | ||
|
||
This routes check applied only for ExApp proxy (``/apps/app_api/proxy/*``). | ||
|
||
|
||
Register | ||
^^^^^^^^ | ||
|
||
During ExApp installation, the ExApp routes are registered automatically. | ||
The routes must be declared in the ``external-app`` - ``routes`` tag of the ``info.xml`` file. | ||
|
||
Example | ||
******* | ||
|
||
.. code-block:: | ||
<routes> | ||
<route> | ||
<url>.*</url> | ||
<verb>GET,POST,PUT,DELETE</verb> | ||
<access_level>USER</access_level> | ||
<headers_to_exclude>[]</headers_to_exclude> | ||
</route> | ||
</routes> | ||
where the fields are: | ||
|
||
- ``url``: the route to be registered on the ExApp side, can be a regex | ||
- ``verb``: the HTTP verb that the route will accept, can be a comma separated list of verbs | ||
- ``access_level``: the name of the access level required to access the route, PUBLIC - public access without auth, USER - Nextcloud user auth required, ADMIN - admin user required | ||
- ``headers_to_exclude``: a json encoded string of an array of strings, the headers that the ExApp wants to be excluded from the request to it | ||
|
||
|
||
Unregister | ||
^^^^^^^^^^ | ||
|
||
ExApp routes are unregistered automatically when the ExApp is uninstalling, or during the ExApp update before registering the new routes. |
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
Oops, something went wrong.