asterics / AsTeRICS-Grid

Free and simple to use app for augmentative and alternative communication (AAC) with offline support, flexible input methods and media access
https://grid.asterics.eu/
GNU Affero General Public License v3.0
55 stars 17 forks source link

Added genereic REST API action #341

Closed deinhofer closed 6 months ago

deinhofer commented 10 months ago

Added genereic REST API action (as of #76 ), which currently supports:

e..g. image

not yet supported

klues commented 6 months ago

I've reviewed everything and did these changes:

Please test everything again at https://grid.asterics.eu/latest/ - I think then we could release it to the main version 🥳

klues commented 6 months ago

I also did tests:

deinhofer commented 6 months ago

I've reviewed everything and did these changes:

* renamed "REST action" to "HTTP action" because I think it's clearer and more generic

* removed some translated strings, since they are the same for all languages, e.g. "HTTP Content-Type", see https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Type

* using a `<select>` element for HTTP method

* using a `<textarea>` element for HTTP body (for being able to define longer payloads

* removed some superfluous HTML in `editHttpAction.vue`

* added documentation, see https://github.com/asterics/AsTeRICS-Grid/blob/latest/docs/documentation_user/05_actions.md#http-action

Please test everything again at https://grid.asterics.eu/latest/ - I think then we could release it to the main version 🥳

Hi,

thanks for reviewing and finalizing!! It looks great!! There is only one thing regarding terminology:

'HTTP Authorization User' and 'HTTP Authorization Password' should 'HTTP Authentication User' and 'HTTP Authentication Password' as it's about authenticating users' credentials, e.g. is it really user A?

Authorization is more about granting different types of operations e.g. read or write.

But besides of that, I think it's read to merge!! :+1:

deinhofer commented 6 months ago

I also did tests:

* [httpbin](https://httpbin.org/#/Auth/get_basic_auth__user___passwd_) for testing authorization. In general it worked, however not for users/passwords including umlauts - but I think that's an error of httpbin.

* ARE REST API, sending a model using `PUT` and `text/xml` - worked!

Do you think we should also add some REST API examples? E.g. for the shelly plug we could describe the following examples:

http://192.168.33.1/relay/0?turn=toggle
http://192.168.33.1/relay/0?turn=off
http://192.168.33.1/relay/0?turn=on

If we documented some cases like this, we would probably don't need to integrate each API with another HTTP action.

klues commented 6 months ago

Thanks for testing! I've changed Authorization to Authentication and released it again to latest. I think we now can release this version to main - I'll do it after the last tests for the word forms feature (#254) are finished.

Regarding the templates - good idea - maybe I'll add it in future releases (we should collect some sensible examples before).

Thanks for your contribution! 👍

deinhofer commented 6 months ago

Thanks for testing! I've changed Authorization to Authentication and released it again to latest. I think we now can release this version to main - I'll do it after the last tests for the word forms feature (#254) are finished.

Regarding the templates - good idea - maybe I'll add it in future releases (we should collect some sensible examples before).

Thanks for your contribution! 👍

Great!! Thanks!!

Yes, let's finally merge!