fix(rbac): privilege exemption for db owner by sml by kailixu · Pull Request #35209 · taosdata/TDengine · GitHub
Skip to content

fix(rbac): privilege exemption for db owner by sml#35209

Open
kailixu wants to merge 2 commits intomainfrom
fix/TS-6976868593-main
Open

fix(rbac): privilege exemption for db owner by sml#35209
kailixu wants to merge 2 commits intomainfrom
fix/TS-6976868593-main

Conversation

@kailixu
Copy link
Copy Markdown
Contributor

@kailixu kailixu commented Apr 22, 2026

Description

Issue(s)

  • Close/close/Fix/fix/Resolve/resolve: Issue Link

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

Copilot AI review requested due to automatic review settings April 22, 2026 09:55
@kailixu kailixu requested review from a team, dapan1121 and guanshengliang as code owners April 22, 2026 09:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts RBAC authorization so that a database owner can perform schemaless (SML) inserts without needing explicit insert privileges, and adds a regression test to validate SML writes by a DB owner.

Changes:

  • Update catalog auth checks to treat “DB owner” as authorized for SML insert flows in more cases.
  • Extend DB-level auth to accept ownership via ownedDbs when checking DB-scoped privileges.
  • Add an integration test that creates a DB as a non-root user and verifies SML ingestion (InfluxDB line protocol + OpenTSDB telnet).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/cases/25-Privileges/test_priv_rbac.py Adds a new privilege regression test covering schemaless inserts by DB owner.
source/libs/catalog/src/ctgUtil.c Extends auth logic to exempt DB owners for certain SML insert / DB-scope authorization checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/libs/catalog/src/ctgUtil.c
Comment thread source/libs/catalog/src/ctgUtil.c
Comment thread test/cases/25-Privileges/test_priv_rbac.py
Comment thread test/cases/25-Privileges/test_priv_rbac.py
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the catalog utility to allow database owners to perform schemaless inserts and pass basic authentication checks without explicit table-level privileges. Specifically, it adds ownership checks in ctgChkSetTbAuthRsp and ctgChkSetBasicAuthRes. Additionally, a new test case do_check_schemaless_db_owner was added to the RBAC test suite to verify that a database owner can successfully perform schemaless writes using InfluxDB and OpenTSDB protocols. I have no feedback to provide as the review comments were explanatory and did not identify any issues.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants