Repository: apache/airflow
File: providers/hashicorp/src/airflow/providers/hashicorp/hooks/vault.py (Python)

Code before:
        """
        return self.vault_client.create_or_update_secret(
            secret_path=secret_path, secret=secret, method=method, cas=cas
        )

    @classmethod
    def get_connection_form_widgets(cls) -> dict[str, Any]:
        """Return connection widgets to add to connection form."""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import BooleanField, IntegerField, StringField
        from wtforms.validators import NumberRange, Optional, any_of

        return {
            "auth_type": StringField(lazy_gettext("Auth type"), widget=BS3TextFieldWidget()),
            "auth_mount_point": StringField(lazy_gettext("Auth mount point"), widget=BS3TextFieldWidget()),
            "kv_engine_version": IntegerField(
                lazy_gettext("KV engine version"),
                validators=[any_of([1, 2])],
                widget=BS3TextFieldWidget(),
                description="Must be 1 or 2.",
                default=DEFAULT_KV_ENGINE_VERSION,
            ),
            "kubernetes_role": StringField(lazy_gettext("Kubernetes role"), widget=BS3TextFieldWidget()),
            "kubernetes_jwt_path": StringField(
                lazy_gettext("Kubernetes jwt path"), widget=BS3TextFieldWidget()
            ),
            "jwt_role": StringField(lazy_gettext("JWT role"), widget=BS3TextFieldWidget()),
            "jwt_token_path": StringField(lazy_gettext("JWT token path"), widget=BS3TextFieldWidget()),
            "token_path": StringField(lazy_gettext("Token path"), widget=BS3TextFieldWidget()),
            "gcp_key_path": StringField(lazy_gettext("GCP key path"), widget=BS3TextFieldWidget()),
            "gcp_scopes": StringField(lazy_gettext("GCP scopes"), widget=BS3TextFieldWidget()),
            "azure_tenant_id": StringField(lazy_gettext("Azure tenant ID"), widget=BS3TextFieldWidget()),
            "azure_resource": StringField(lazy_gettext("Azure resource"), widget=BS3TextFieldWidget()),
            "radius_host": StringField(lazy_gettext("Radius host"), widget=BS3TextFieldWidget()),
            "radius_port": IntegerField(
                lazy_gettext("Radius port"),
                widget=BS3TextFieldWidget(),
                validators=[Optional(), NumberRange(min=0)],
            ),
            "use_tls": BooleanField(lazy_gettext("Use TLS"), default=True),
        }

    @classmethod
    def get_ui_field_behaviour(cls) -> dict[str, Any]:
        """Return custom field behaviour."""
        return {
            "hidden_fields": ["extra"],
            "relabeling": {},
        }


Review comment (suggestion):
`jwt_token` is missing I think.

```suggestion
            "jwt_role": StringField(lazy_gettext("JWT role"), widget=BS3TextFieldWidget()),
            "jwt_token": StringField(lazy_gettext("JWT token"), widget=BS3TextFieldWidget()),
```

Code after:
            secret_path=secret_path, secret=secret, method=method, cas=cas
        )

    @classmethod
    def get_connection_form_widgets(cls) -> dict[str, Any]:
        """Return connection widgets to add to connection form."""
        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
        from flask_babel import lazy_gettext
        from wtforms import BooleanField, IntegerField, StringField
        from wtforms.validators import NumberRange, Optional, any_of

        return {
            "auth_type": StringField(lazy_gettext("Auth type"), widget=BS3TextFieldWidget()),
            "auth_mount_point": StringField(lazy_gettext("Auth mount point"), widget=BS3TextFieldWidget()),
            "kv_engine_version": IntegerField(
                lazy_gettext("KV engine version"),
                validators=[any_of([1, 2])],
                widget=BS3TextFieldWidget(),
                description="Must be 1 or 2.",
                default=DEFAULT_KV_ENGINE_VERSION,
            ),
            "kubernetes_role": StringField(lazy_gettext("Kubernetes role"), widget=BS3TextFieldWidget()),
            "kubernetes_jwt_path": StringField(
                lazy_gettext("Kubernetes jwt path"), widget=BS3TextFieldWidget()
            ),
            "jwt_role": StringField(lazy_gettext("JWT role"), widget=BS3TextFieldWidget()),
            "jwt_token": StringField(lazy_gettext("JWT token"), widget=BS3TextFieldWidget()),
            "jwt_token_path": StringField(lazy_gettext("JWT token path"), widget=BS3TextFieldWidget()),
            "token_path": StringField(lazy_gettext("Token path"), widget=BS3TextFieldWidget()),
            "gcp_key_path": StringField(lazy_gettext("GCP key path"), widget=BS3TextFieldWidget()),
            "gcp_scopes": StringField(lazy_gettext("GCP scopes"), widget=BS3TextFieldWidget()),
            "azure_tenant_id": StringField(lazy_gettext("Azure tenant ID"), widget=BS3TextFieldWidget()),
            "azure_resource": StringField(lazy_gettext("Azure resource"), widget=BS3TextFieldWidget()),
            "radius_host": StringField(lazy_gettext("Radius host"), widget=BS3TextFieldWidget()),
            "radius_port": IntegerField(
                lazy_gettext("Radius port"),
                widget=BS3TextFieldWidget(),
                validators=[Optional(), NumberRange(min=0)],
            ),
            "use_tls": BooleanField(lazy_gettext("Use TLS"), default=True),
        }

    @classmethod
    def get_ui_field_behaviour(cls) -> dict[str, Any]:
        """Return custom field behaviour."""
        return {
            "hidden_fields": ["extra"],
            "relabeling": {},
        }

    def test_connection(self) -> tuple[bool, str]: