### Apache Airflow version

2.3.3 (latest released)

### What happened

I accidentally (and then intentionally) added leading and trailing white spaces while adding connection parameters in Airflow UI Connections form. What followed was an error message that was not so helpful in tracking down the input error by the user.



### What you think should happen instead

Ideally, I expected that there should be a frontend or backend logic that strips off accidental leading or trailing white spaces when adding Connections parameters in Airflow.

### How to reproduce

Intentionally add leading or trailing white spaces while adding Connections parameters.
<img width="981" alt="Screenshot 2022-07-22 at 18 49 54" src="https://user-images.githubusercontent.com/9834450/180497315-0898d803-c104-4d93-b464-c0b33a466b4d.png">



### Operating System

Mac OS

### Versions of Apache Airflow Providers

_No response_

### Deployment

Astronomer

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

mock_base_hook, mock_pm_hooks, mock_import_str
):
    """
    Test the handling of sensitive unchanged field (where placeholder has not been modified).
    """
    
    mock_form = mock.Mock()
    mock_form.data = {
        "conn_type": "test4",
        "conn_id": "extras_test4",
        "extra": '{"sensitive_extra": "RATHER_LONG_SENSITIVE_FIELD_PLACEHOLDER", "extra__custom": "value"}',
    }
    mock_base_hook.get_connection.return_value = Connection(extra='{"sensitive_extra": "old_value"}')
    cmv = ConnectionModelView()
    cmv._iter_extra_field_names_and_sensitivity = mock.Mock(
        return_value=[("sensitive_extra_key", "sensitive_extra", True)]
    )
    cmv.process_form(form=mock_form, is_created=True)
    assert json.loads(mock_form.extra.data) == {
        "extra__custom": "value",
        "sensitive_extra": "old_value",
    }
def test_duplicate_connection(admin_client):