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

feat: Support revoke command/grant command improvements for Clickhouse #229

Merged
merged 6 commits into from
Oct 22, 2024

Conversation

viladimiru
Copy link
Contributor

No description provided.

@viladimiru viladimiru self-assigned this Oct 11, 2024
@viladimiru viladimiru changed the title feat: Support revoke command for Clickhouse feat: Support revoke command for Clickhouse/grant command fixes Oct 11, 2024
@viladimiru viladimiru changed the title feat: Support revoke command for Clickhouse/grant command fixes feat: Support revoke command for Clickhouse/grant command improvements Oct 11, 2024
@viladimiru viladimiru changed the title feat: Support revoke command for Clickhouse/grant command improvements feat: Support revoke command/grant command improvements for Clickhouse Oct 11, 2024
: GRANT clusterClause? privilegeList ON grantSubjectIdentifier TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
| GRANT clusterClause? roleIdentifier TO userOrRoleExpressionList (WITH ADMIN OPTION)? (WITH REPLACE OPTION)?
: GRANT clusterClause? (privilegeList ON grantSubjectIdentifier) (COMMA privilegeList ON grantSubjectIdentifier)* TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
| GRANT clusterClause? roleExpressionList TO userOrRoleExpressionList (WITH ADMIN OPTION)? (WITH REPLACE OPTION)?
| GRANT CURRENT GRANTS ((LPAREN privilegeList ON grantSubjectIdentifier RPAREN) | ON grantSubjectIdentifier) TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
;

grantSubjectIdentifier
Copy link
Collaborator

@NikitaShkaruba NikitaShkaruba Oct 21, 2024

Choose a reason for hiding this comment

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

nit: Let's rename it to accessSubjectIdentifier? It's being used in revoke

: GRANT clusterClause? privilegeList ON grantSubjectIdentifier TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
| GRANT clusterClause? roleIdentifier TO userOrRoleExpressionList (WITH ADMIN OPTION)? (WITH REPLACE OPTION)?
| GRANT CURRENT GRANTS ((LPAREN privilegeList ON grantSubjectIdentifier RPAREN) | ON grantSubjectIdentifier) TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
: GRANT clusterClause? (privilegeList ON accessSubjectIdentifier) (COMMA privilegeList ON accessSubjectIdentifier)* TO userOrRoleExpressionList (WITH GRANT OPTION)? (WITH REPLACE OPTION)?
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think we can move out WITH REPLACE OPTION, it is copy pasted multiple times

expect(autocompleteResult.errors).toHaveLength(0);
});

test('should not report errors', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd give these tests different names, because if one of them fails it will be hard to understand which one

@viladimiru viladimiru merged commit 80f32b0 into main Oct 22, 2024
4 checks passed
@viladimiru viladimiru deleted the feat/support-revoke-rule branch October 22, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants