Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow variables to be used as part of a value in configuration.#7464

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
joeriddles wants to merge3 commits intonats-io:main
base:main
Choose a base branch
Loading
fromjoeriddles:fix-5320

Conversation

@joeriddles
Copy link

@joeriddlesjoeriddles commentedOct 22, 2025
edited
Loading

Resolves:#5320

Based on#5544

Requires double dollar signs in strings to use variables (similar to using an environment variable in a Makefile). This solves@wallyqs's comment on the original pull request by preventing values like "$SYS" getting misinterpreted as a variable.

Note that using double dollar signs outside of string quotes is invalid. Existing parsing behavior of a single dollar sign outside of quotes remains unaffected.

Signed-off-by: Joseph Riddlejoe@synadia.com

@joeriddlesjoeriddles requested a review froma team as acode ownerOctober 22, 2025 21:23
Signed-off-by: Joseph Riddle <joe@synadia.com>
Signed-off-by: Joseph Riddle <joe@synadia.com>
Copy link
Member

@MauriceVanVeenMauriceVanVeen left a comment

Choose a reason for hiding this comment

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

Thank you for getting this going 👍

In general I'd want to advocate for having both syntaxes work for the normal case. And instead of$$TOKEN I'd personally prefer the use of${TOKEN} like was suggested here:#5320 (comment).

Then you'd be able to use thepassword: $TOKEN syntax that's supported normally but not for embedding. And then bothpassword: ${TOKEN} should work and the embedded case ofnats://user:${TOKEN}@localhost:6222.
That would allow someone to fully switch to the new syntax of${TOKEN} also for the normal case, to keep the config consistent.

authorization {
user: user
# normal variable syntax
password: $TOKEN

Choose a reason for hiding this comment

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

The test currently fails due to it not recognizing theTOKEN here. After removing theauthorization block such that it can only fail on the embedded syntax, the test doesn't fail anymore and contains an unresolvednats://user:$$TOKEN@server.example.com:6222.

authorization {
user: user
# normal variable syntax
password: $TOKEN

Choose a reason for hiding this comment

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

Should also add a test wherepassword: is used with the other syntax. Currently if you try$$TOKEN here it fails.

Signed-off-by: Joseph Riddle <joe@synadia.com>
@joeriddles
Copy link
Author

@MauriceVanVeen I updated to use the brace syntax you and the commenter on the issue suggested. Also updated the tests based on the changes and your feedback. Thanks

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@MauriceVanVeenMauriceVanVeenMauriceVanVeen requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Allow variables to be used as part of a value in configuration

2 participants

@joeriddles@MauriceVanVeen

[8]ページ先頭

©2009-2025 Movatter.jp