Skip to content

Authorize glossary term createMany per term (2.0 backport) - #36071

Merged
sonika-shah merged 2 commits into
2.0from
fix/glossary-createmany-authz-2.0
Oct 26, 2026
Merged

sonika-shah merged 2 commits into
2.0from
fix/glossary-createmany-authz-2.0

Conversation

@sonika-shah

@sonika-shah sonika-shah commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes open-metadata/openmetadata-collate#7804

Summary

Backport of the authorization part of #35910 to 2.0. On 2.0, POST /v1/glossaryTerms/createMany mapped and stored terms without any authorization check, so a caller without CREATE could bulk-create terms in any glossary.

Fix: each term is checked for limits and CREATE (with its glossary/parent as context) before anything is written, the same check main does.

What changed

  • GlossaryTermResource.createMany authorizes every term via authorizedTerm before calling repository.createMany.
  • GlossaryTermResourceIT.createMany_deniedCallerCannotCreateTerms: a user denied CREATE gets 403 and no term is created (fails without the fix: 200 and the term is stored).
Details
  • Only the authorization change is backported; the bulk-create outcome API (onConflict, BulkCreateResult, SDK changes) from Fixes 35909: report bulk-create outcomes and recover conflicts #35910 stays main-only.
  • deniedGlossaryEditToken is generalized to deniedGlossaryOperationToken(ns, suffix, operation), matching main.
  • Ran locally against 2.0: the new IT red without the fix, green with it.

RetriggerView in GreptileConfidence Score: 4/5

The authorization change looks sound, but the Java guide requirements must be met before merging.

Findings

  1. P2 Test client stays open ▶

Summary

Adds per-term CREATE and limit checks to createMany before the repository writes any terms.

  • Bulk glossary-term requests check permission before they create terms.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Receive terms] --> B[Map each term]
  B --> C[Check limits and CREATE permission]
  C -->|Any check fails| D[Reject without saving terms]
  C -->|All checks pass| E[Save terms]
Loading

Reviews (2) · Last reviewed commit: "Merge branch '2.0' into fix/glossary-cre..." · Reviewed by Greptile

createMany mapped and stored the terms without any authorization check, so a
caller without CREATE could bulk-create terms in any glossary. Each term is now
checked for limits and CREATE before anything is written, as in main (#35910).
@sonika-shah
sonika-shah requested a review from a team as a code owner October 23, 2026 08:06
@sonika-shah
sonika-shah requested review from pmbrull and removed request for a team October 23, 2026 08:06
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • Linked issue open-metadata/openmetadata-collate#7804 does not exist or is not accessible.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 23, 2026
@gitar-bot

gitar-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Per-term CREATE checks gate bulk glossary-term writes; a context or policy error could allow unauthorized terms or reject legitimate batches.

Adds per-term authorization to POST /v1/glossaryTerms/createMany on 2.0, so each term is checked for limits and CREATE against its glossary or parent before anything is written. A denied caller now gets 403 and no terms are created. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonika-shah
sonika-shah merged commit c30e697 into 2.0 Oct 26, 2026
53 of 57 checks passed
@sonika-shah
sonika-shah deleted the fix/glossary-createmany-authz-2.0 branch October 26, 2026 13:49
@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants