-
Notifications
You must be signed in to change notification settings - Fork 700
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
Fix for ignoring a private inbox prefix in jetstream publish. #1474
Conversation
I hope this can get merged quickly, we need this for production code. |
Thanks for the PR! I will took a look into it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
This change does fix ignoring the prefix, however it should use the short token variant (as used for the other part of the reply subject).
Please let me know if you need help with that.
I have no idea what you are talking about. What short token variant? How is that related to the inbox prefix? Sounds as if there are other concerns about your code. I just replaced the inbox prefix which was also a simple string before. |
Hey, The issue is that It returns Let's take an example:
Now, as the reply subject sub is created here: js.publisher.replyPrefix = fmt.Sprintf("%s%s.", js.conn.NewInbox(), b[:aReplyTokensize]) if The resulting inbox sub will be: while it should be If that is confusing (as those are some internal NATS conventions), If you allowed contributors pushing to your branch, I can fix this one with a second commit. Or you can amend your changes. Whatever you prefer 🙂 |
a379552
to
8eea3f9
Compare
@Jarema Yes, that was an oversight of me. Sorry for not getting it directly. That is fixed, but there are so many ways to code it. I saw other instances using a string builder or an optimal allocation + copy. I kept it at the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for your contribution!
What is the ETA for this bugfix to be included in a release? |
Our application did not work anymore after adding some more security to it. Turned out that jetstream publish is not obeying a custom inbox prefix.