TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
974 stars 305 forks source link

Fix skip payload crypto settings in the Console #4782

Closed kschiffer closed 2 years ago

kschiffer commented 2 years ago

Summary

The Console currently only allows setting Skip payload crypto on the device level. It should also be possible to set the payload cypto skipping on the link (Application) level. Additionally, the field should allow three states -> Enabled, disabled, default.

Please see also: https://github.com/TheThingsIndustries/lorawan-stack-support/issues/485

Why do we need this?

The incomplete feature in the Console currently causes confusion and it also produces irreversible conditions since there is no way to reset the option (Use default).

What is already there? What do you see now?

We currently have a checkbox option in the end device general settings Skip payload crypto.

What is missing? What do you want to see?

Action items are:

  • Add a skip_payload_crypto field to application general settings
  • Add a tooltip for this field explaining the effects and how the setting can be overridden on device level
  • On end device level, the field should consist of a radio button group with three settings as desribed above ("default" option would null the field)
  • Disable the setting when AWS IoT core is enabled and use a field description to explain about why

How do you propose to implement this?

The form will make a request to the SetLink rpc of the As service. For this we will need to add an setApplicationLinkLogic() to /pkg/webui/console/store/middleware/logics/applications.js, along with the necessary redux primitives (actions, reducers, selectors). The form can then make the request to the backend via a store dispatch.

How do you propose to test this?

Since this setting is a bit interconnected, it makes sense to add an end-to-end test case here as well, which

Can you do this yourself and submit a Pull Request?

@ryaplots

ryaplots commented 2 years ago

I will try