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

[v23.2.x] schema_registry: Improve sanitization of Avro namespaces #12418

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #12334
Fixes: #12416,

Pass a context instead of just a memoryt allocator.

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 312817c)
If the name field is a fullname, then an existing namespace is ignored.

Sanitize splits the fullname into name and namespace, so rewrite the
namespace rather than returning an error.

Reference: https://avro.apache.org/docs/1.11.1/specification/#names

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 29af7c8)
Check that simple namespace cases are left alone.

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 6e7c061)
This PR keeps track of the current namespace in a stack, starting with
the implicitly null "empty" namespace.

If the namespace changes, push it to the stack.

If a namespace is redundant (the same as outer scope), remove it.

Fixes redpanda-data#11912

Signed-off-by: Ben Pope <[email protected]>
(cherry picked from commit 9cfd7bd)
@vbotbuildovich vbotbuildovich added this to the v23.2.x-next milestone Jul 24, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 24, 2023
@BenPope BenPope self-assigned this Jul 24, 2023
@BenPope BenPope marked this pull request as ready for review July 24, 2023 13:08
@BenPope
Copy link
Member

BenPope commented Jul 24, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants