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.1.x] schema_registry: Improve sanitization of Avro namespaces #12425

Merged

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Jul 24, 2023

Backport of PR #12334
Fixes: #12415,

Manual backport because <stack> wasn't included

Closes #12417

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)
@BenPope BenPope added area/schema-registry Schema Registry service within Redpanda kind/backport PRs targeting a stable branch labels Jul 24, 2023
@BenPope BenPope added this to the v23.1.14 milestone Jul 24, 2023
@BenPope BenPope self-assigned this Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda area/schema-registry Schema Registry service within Redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants