Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Provide a way to do character/string escaping #37

Closed
ChunyiLyu opened this issue Apr 17, 2023 · 1 comment · Fixed by #48
Closed

[Feature request] Provide a way to do character/string escaping #37

ChunyiLyu opened this issue Apr 17, 2023 · 1 comment · Fixed by #48

Comments

@ChunyiLyu
Copy link

# is always treated as the start of a comment and there seems to be no way to do escaping in cuttlefish. This is a problem for the Cluster Operator and vault integration because passwords generated by vault could contain character # which leads to the value being read incorrectly by RabbitMQ (default user credentials are being configured via rabbitmq conf files in Cluster Op).

Could we consider adding character escaping into cuttlefish?

Related issue: rabbitmq/cluster-operator#1326

@MaximPopov
Copy link

I second this request. There are other cases when # character is needed in a value, for example, MQTT topic match patterns.

Thanks!

michaelklishin added a commit that referenced this issue Aug 3, 2024
Currently Cuttlefish does not support string
values that include the # character.

This character is, however, used every so often
in generated passwords, identifiers and other
machine-produced values.

This PR introduces an alternative value
representation:

```
a.setting = 'sdkjf#hsdf$82836867#9237498'
```

which allows such values to be escaped using
single quotes. Single quotes are NOT
supported by these values by design,
I do not thing that the \' escaping would
be worth our time.

This also drops an invalid UTF-8 input
test that I could not get to work.
Somewhere inside Neotoma a returned error
has turned into an exception. Either way,
the limited validation for valid UTF-8 characters
is still in place.

Closes #37.

References #31.
lukebakken pushed a commit that referenced this issue Aug 5, 2024
Currently Cuttlefish does not support string values that include the #
character.

This character is, however, used every so often in generated passwords,
identifiers and other machine-produced values.

This PR introduces an alternative value representation:

```
a.setting = 'sdkjf#hsdf$82836867#9237498'
```

...which allows such values to be escaped using single quotes. Single
quotes are NOT supported by these values by design, I do not thing that
the \' escaping would be worth our time.

This also drops an invalid UTF-8 input test that I could not get to
work. Somewhere inside Neotoma a returned error has turned into an
exception. Either way, the limited validation for valid UTF-8 characters
is still in place.

Closes #37.

References #31.

* Add an integration test for 'escaped values'
* One more test case for escaped values
* Fix `invalid_utf8_test` test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants