Skip to content

[Improvement-18072][Api] Add user permission validation logic to the getDatabases, getTables, and getTableColumns methods in DataSourceController#18073

Open
njnu-seafish wants to merge 4 commits intoapache:devfrom
njnu-seafish:Improvement-18072
Open

[Improvement-18072][Api] Add user permission validation logic to the getDatabases, getTables, and getTableColumns methods in DataSourceController#18073
njnu-seafish wants to merge 4 commits intoapache:devfrom
njnu-seafish:Improvement-18072

Conversation

@njnu-seafish
Copy link
Contributor

Was this PR generated or assisted by AI?

NO

Purpose of the pull request

close #18072

Brief change log

Add user permission validation logic to the getDatabases, getTables, and getTableColumns methods in DataSourceController

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Mar 18, 2026
@SbloodyS SbloodyS added this to the 3.4.2 milestone Mar 18, 2026
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
26.7% Coverage on New Code (required ≥ 60%)
13.6% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

Please revert the unrelated change, you should review your pr first.

@ApiException(VERIFY_DATASOURCE_NAME_FAILURE)
public Result<Boolean> verifyDataSourceName(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "name") String name) {
public Result<Boolean> verifyDataSourceName(@RequestParam(value = "name") String name) {
Copy link
Member

Choose a reason for hiding this comment

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

Don't change this method.

* @return a boolean indicating whether Kerberos is currently active
*/
@Operation(summary = "getKerberosStartupState", description = "GET_USER_INFO_NOTES")
@Operation(summary = "getKerberosStartupState", description = "GET_KERBEROS_STARTUP_STATE")
Copy link
Member

Choose a reason for hiding this comment

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

Don't change the unrelated code of this issue.

@njnu-seafish
Copy link
Contributor Author

Please revert the unrelated change, you should review your pr first.

Okay, I will create a separate issue and PR to address the inconsistent class comments in these classes.

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

Labels

backend improvement make more easy to user or prompt friendly test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][Api] Add user permission validation logic to the getDatabases, getTables, and getTableColumns methods in DataSourceController

3 participants