Skip to content

Conversation

@lukebakken
Copy link
Collaborator

@lukebakken lukebakken commented Oct 27, 2025

Fixes #60

Multiline values will be configured using typical "here document" syntax:

a.b = '''
  l0
  l1
  l2
'''

@lukebakken lukebakken added this to the 3.6.0 milestone Oct 27, 2025
@lukebakken lukebakken self-assigned this Oct 27, 2025
@lukebakken lukebakken force-pushed the cuttlefish-60-multiline-values branch from 089a67c to 0fd1922 Compare October 27, 2025 18:12
Copy link
Collaborator

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm impressed with how small the parser/grammar part of the change turned out to be.

The tests are very minimalistic and there's a newline character at the beginning of the value that might be worth stripping off but otherwise, this looks less intrusive than the escaped value support change was.

@the-mikedavis the-mikedavis self-requested a review October 27, 2025 21:54
@lukebakken lukebakken force-pushed the cuttlefish-60-multiline-values branch 3 times, most recently from 15ccbaf to 246404b Compare October 27, 2025 22:36
@lukebakken lukebakken marked this pull request as ready for review October 27, 2025 22:39
@the-mikedavis
Copy link
Collaborator

There was some discussion of newline handling in the EEP for it https://www.erlang.org/eeps/eep-0064#leading-and-trailing-newline

Stripping exactly one leading and trailing newline seems reasonable to me but I don't have strong feelings either way

@lukebakken lukebakken marked this pull request as draft October 27, 2025 22:53
@lukebakken lukebakken marked this pull request as ready for review October 27, 2025 22:57
@lukebakken lukebakken marked this pull request as draft October 27, 2025 22:57
@lukebakken lukebakken force-pushed the cuttlefish-60-multiline-values branch 2 times, most recently from be5a545 to 33596a4 Compare October 27, 2025 23:32
@lukebakken
Copy link
Collaborator Author

@the-mikedavis I decided to implement stripping leading/trailing newlines and \r\n - https://github.com/Kyorai/cuttlefish/pull/63/files#diff-a3ec14543b4f8119a76411f13100547ab44f72acf1211e9b13418d05182720e5R72

@lukebakken lukebakken marked this pull request as ready for review October 27, 2025 23:35
Fixes #60

Multiline values will be configured using typical "here document"
syntax:

```
a.b = '''
  l0
  l1
  l2
'''
```

All leading and trailing \n and \r in multiline values are trimmed.

* Add support for single-quote delimited multiline here-documents
* Fix match assertion to take win32 into account
* Add multiline_empty_test
* Add test for `value` multiline case.
* Normalize newlines prior to match in tests for win32 systems.
* Add test for multiline values that contain "special" characters.
* Add test for unclosed here-document.
* Add test for embedded `'''` which is a syntax error.
* Add test for multiple here-documents in a conf file.
* Add test that mixes simple and multiline values.
* Add test with whitespace-only here-document.
* Add test where here-document includes `#include` statements.
* Add test when file does not end with newline.
* Document syntax in README
* Add here-document test with unicode.
@lukebakken lukebakken force-pushed the cuttlefish-60-multiline-values branch from 33596a4 to c74c263 Compare October 27, 2025 23:38
@michaelklishin
Copy link
Collaborator

michaelklishin commented Oct 27, 2025

Given how this feature will be used (e.g. for specifying LDAP queries "inline" in rabbitmq.conf), the leading newline sounds acceptable. I mean, there is a newline after the raw string ("heredoc") start sequence.

It will be more problematic for x.509 certificates where newlines can wreck parsing with very obscure errors elsewhere.

@lukebakken @the-mikedavis I think dealing with the newline is something that can be handled by two different data types without any further parser changes:

  1. A multiline string type will have what we currently have
  2. A stripped (sanitized?) multiline string type can string the leading and trailing newlines. We can call it "inline certificate" or something, to reflect its expected most common use.

This is the approach we have taken for tweaking how encrypted values are parsed, except that there we did not end up with one value but rather replaced one possible implementation with another over time to support values with certain characters in the middle.

@michaelklishin
Copy link
Collaborator

I have pushed a small fixture file update… in part because I can :D

@michaelklishin michaelklishin merged commit 79ff833 into main Oct 28, 2025
6 checks passed
@michaelklishin michaelklishin deleted the cuttlefish-60-multiline-values branch October 28, 2025 00:06
michaelklishin added a commit that referenced this pull request Oct 28, 2025
Added entry for multiline string support in v3.6.0.
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 28, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 28, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 28, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 29, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 29, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 30, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
lukebakken added a commit to amazon-mq/upstream-to-rabbitmq-server that referenced this pull request Oct 30, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63
mergify bot pushed a commit to rabbitmq/rabbitmq-server that referenced this pull request Oct 30, 2025
The cuttlefish project recently added support for multiline values. The
primary motivation for this is so that LDAP settings like
`vhost_access_query` could now be expressed in `rabbitmq.conf`, rather
than requiring `advanced.config`.

These changes require cuttlefish version `3.6.0` or later.

References:
* Kyorai/cuttlefish#60
* Kyorai/cuttlefish#63

(cherry picked from commit 813617a)
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 this pull request may close these issues.

Support multi-line values

3 participants