Skip to content

[FIXED] JetStream: cross-account mirror with subject transform issue #6759

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

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

kozlovic
Copy link
Member

@kozlovic kozlovic commented Apr 3, 2025

Using import/export, if one tries to limit the consumer create API with specific stream name and subject filter, the sync of a mirror would fail if using a single subject transform.

This PR checks that if there is no filter subject, but a single entry in FilterSubjects, then we switch to simple FilterSubject as to allow the use of the extended consumer create API that allows for fine grained permissions.

Resolves #6751

Signed-off-by: Ivan Kozlovic [email protected]

Using import/export, if one tries to limit the consumer create API
with specific stream name and subject filter, the sync of a mirror
would fail if using a single subject transform.

This PR checks that if there is no filter subject, but a single
entry in FilterSubjects, then we switch to simple FilterSubject
as to allow the use of the extended consumer create API that
allows for fine grained permissions.

Resolves #6751

Signed-off-by: Ivan Kozlovic <[email protected]>
@kozlovic kozlovic requested a review from a team as a code owner April 3, 2025 21:33
@kozlovic
Copy link
Member Author

kozlovic commented Apr 3, 2025

@derekcollison @jnmoyne @ripienaar I would like you to have a look at this PR. It looks like what was done for source streams was not done for mirrors. I took a slightly different approach that for sources, but it is equivalent, that is, if there is no FilterSubject config and a single SubjectTransforms entry, then use that one as a FilterSubject, which allows the use of the extended consumer create API.

It looks like nats uses a subject transform to pass a subject filter (at least, I did not see the option to specify FilterSubject when creating the mirror). So with a config that allows only certain consumer create subjects, it would fail without this change.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jnmoyne jnmoyne left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 02a1d5a into main Apr 4, 2025
37 checks passed
@derekcollison derekcollison deleted the fix_6751 branch April 4, 2025 15:22
neilalexander added a commit that referenced this pull request Apr 17, 2025
Includes the following (already cherry-picked) PRs:

- #6587
- #6607
- #6612
- #6609
- #6620
- #6668
- #6674
- #6647
- #6684
- #6691
- #6697
- #6705
- #6706
- #6704
- #6714
- #6720
- #6727
- #6730
- #6726
- #6732
- #6759
- #6753
- #6685
- #6769
- #6777
- #6785
- #6786
- #6778
- #6790
- #6791
- #6798
- #6794
- #6801

Signed-off-by: Neil Twigg <[email protected]>

Signed-off-by: Neil Twigg <[email protected]>
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.

Jetstream cross-account mirror doesn't work with API filter
3 participants