Repository: privacyidea/privacyidea

Issue:
UI does not display input elements in eventhandler actions
The UI uses the type `str` to display an input element:
https://github.com/privacyidea/privacyidea/blob/3c9a0e25a304d586d71f0192b0abae2f3ae219df/privacyidea/static/components/config/views/config.events.details.html#L286

In the token event-handler, some actions are declared with the type `string` and thus not input element is shown:
![grafik](https://user-images.githubusercontent.com/37443810/223693029-a270c456-593c-4840-89d9-b9910bdd7168.png)



Discussion:
There is this definition:

https://github.com/privacyidea/privacyidea/blob/ac9135f1c48449a8121afa30ea67b41dea215dea/privacyidea/lib/policy.py#L397-L400

We should use it in all policy definitions and event handlers!

Resolving patch:
diff --git a/privacyidea/lib/eventhandler/tokenhandler.py b/privacyidea/lib/eventhandler/tokenhandler.py
--- a/privacyidea/lib/eventhandler/tokenhandler.py
+++ b/privacyidea/lib/eventhandler/tokenhandler.py
@@ -305,7 +305,7 @@ def actions(cls):
                    ACTION_TYPE.ADD_TOKENGROUP:
                        {"tokengroup":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "required": True,
                                 "description": _("Add a tokengroup to the token."),
                                 "value": [tg.name for tg in get_tokengroups()]
@@ -314,7 +314,7 @@ def actions(cls):
                    ACTION_TYPE.REMOVE_TOKENGROUP:
                        {"tokengroup":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "required": True,
                                 "description": _("Remove a tokengroup from the token."),
                                 "value": [tg.name for tg in get_tokengroups()]
@@ -323,7 +323,7 @@ def actions(cls):
                    ACTION_TYPE.ATTACH_APPLICATION:
                        {"machine ID":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "required": False,
                                 "description": _("The ID of the machine you want to attach the token to")
 
@@ -337,7 +337,7 @@ def actions(cls):
                         },
                         "application":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "required": True,
                                 "description": _("Set a token application like 'offline' or 'SSH'. Note: Not all tokens"
                                                  " work well with all applications!"),
@@ -345,7 +345,7 @@ def actions(cls):
                             },
                         "count":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "visibleIf": "application",
                                 "visibleValue": TOKEN_APPLICATIONS.OFFLINE,
                                 "description": _("The number of offline OTP values available"),
@@ -353,7 +353,7 @@ def actions(cls):
                             },
                         "rounds":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "visibleIf": "application",
                                 "visibleValue": TOKEN_APPLICATIONS.OFFLINE,
                                 "description": _("The number of rounds for password hashing"),
@@ -361,21 +361,21 @@ def actions(cls):
                             },
                         "user":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "visibleIf": "application",
                                 "visibleValue": TOKEN_APPLICATIONS.SSH,
                                 "required": False
                             },
                         "slot":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "visibleIf": "application",
                                 "visibleValue": TOKEN_APPLICATIONS.LUKS,
                                 "required": False
                             },
                         "partition":
                             {
-                                "type": "string",
+                                "type": "str",
                                 "visibleIf": "application",
                                 "visibleValue": TOKEN_APPLICATIONS.LUKS,
                                 "required": False


Test patch: