20 Commits

Author SHA1 Message Date
b6fc846960 fix: for transfer encoding causing problems
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2025-07-30 17:17:53 +00:00
4f9cba3cc5 fix: implement streaming
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
2025-07-08 15:26:09 +00:00
f94ac10131 feat: lowercase headers to exclude in exapp proxy
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
2025-04-22 13:16:42 +00:00
4bcd2b002a fix: remove "content-length" in AppAPI proxy
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
2025-04-01 10:06:11 +00:00
eda9c80ab6 ability to enable bruteforce protection for ExApp routes (#368)
```xml
<route>
	<url>^api\/w\/nextcloud\/jobs\/.*</url>
	<verb>GET,POST,PUT,DELETE</verb>
	<access_level>PUBLIC</access_level>
	<headers_to_exclude>[]</headers_to_exclude>
	<bruteforce_protection>[401, 500]</bruteforce_protection>
</route>
```

Looks like this. ExApps should not implement its own protection, we
should provide a way to enable basic protection from Nextcloud/AppAPI
side.

---------

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
2024-08-22 19:25:40 +00:00
5e907e84aa Proxy: check all routes until we find allowing route (#366)
Yes, it changes the algorithm, but otherwise it does not work in PGSQL
in production.

And so it is a little simpler, since the order of routes in `info.xml`
is not important

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-22 15:51:15 +03:00
685ca6311f debug logging to the Proxy (#365)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-22 14:38:09 +03:00
2374d552be Proxy: do not set timeout for requests to ExApp (#357)
We forgot to change this in this PR:
https://github.com/cloud-py-api/app_api/pull/277

For Proxy requests there should be no timeout, cause they are coming
from user or external services and not from Nextcloud

Even if they will take a long time, Nextcloud instance will be not slow
down

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-08 16:43:50 +03:00
1554fc82da fix: Proxy: do not trust input - always set own value for 'X-Origin-IP' (#354)
An external packet received by the proxy can have any value in
'X-Origin-IP' - we can't trust it, it's best to set it on our own

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-07 13:23:16 +03:00
073a2baf92 feat(ExAppProxy): add X-Origin-IP header for rate-limiting purposes… (#351)
… for ExApp

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2024-08-05 18:51:21 +03:00
65003cd5d1 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 <andrey18106x@gmail.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2024-08-02 16:47:06 +03:00
b72baacaf5 AppAPIProxy: fixed PUT requests processing with content (#331)
Treat `PUT` with the same logic as `DELETE`

`$_POST` and `$_FILES` are always empty as PHP automatically does not
parse data during `PUT`

Just send raw request which we received to ExApp.

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-07-19 22:12:36 +03:00
fc345eba88 AppAPIProxy: send raw data and all headers to ExApp (#330)
We don't have to build the request data again, it's already original in
'php://input'

It is also better to send all headers.

Perhaps we don’t need the code with “buildMultipartFormData” either

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-07-19 18:12:55 +00:00
eea14dc504 optimization: system flag and ex_app_users removal (#323)
The system flag and extra table for that `ex_app_users` is removed to
optimize database usage and simplify the system logic.

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2024-07-11 17:08:52 +00:00
26d61a40bd UIProxy: fixed incorrect the Domain of cookie (#305)
Currently cookies always rejected when ExApp is installed in DSP with
`HTTPS` - this is now fixed.

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-06-12 14:18:46 +03:00
0a80c686df ExApp proxy adjustments and fixes (#296)
This PR made a few changes to ExApp proxy:

1. Fix Get requests proxy to preserve the url params
2. Add pass of cookies to the ExApp with request
3. Fixes Proxy work with multipart requests and files using separate
internal version of requestToExApp with slightly adjusted handling of
query and body params
4. Remove default caching for json requests

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2024-06-10 20:50:42 +03:00
2dc82deaf1 adjusted how headers are passing from ExApp to client (#246)
Hope that this refactoring will not break anything :)

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-03-12 15:37:01 +03:00
003794670a Daemon Templates, Docker Socket Proxy, AppAPI 2.0 (#212) 2024-01-25 12:33:48 +00:00
215354ebdb makefile adjustments, added DELETE for Proxyfier (#145)
The final adjustments, nothing more for the next version
2023-12-06 19:09:08 +03:00
50277224d3 ExApp UI Implementation (Part1) (#135)
This PR adds ability for ExApp to have entry in TopMenu and provide it's
own page when clicking on it.

* OCS API for specifying InitialStates, Scripts, Styles, TopMenu
* Small corrections and refactoring of code that relates on UI
* Small bug fixes to other parts of AppAPI, mostly for FileActions Menu.

PR is ready, after merging this, one additional PR will be created that
relates to this one.
That PR will cover missing parts:
* Docs, changelog update
* FileActions Menu rework(icon specifying)
* Fixes of stuff that will be found if any, related to UI
* CI Actions and Makefile adjusting, to keep `js/proxy_js` folder
* Fix of Proxying stuff

Merging this PR will allow nc_py_api's PR to be finished on this theme
and finish first example for testing.

---------

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
2023-12-03 16:30:03 +03:00