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

Support db_securityadmin #70

Merged
merged 55 commits into from
Oct 31, 2024
Merged

Conversation

HarshLunagariya
Copy link

@HarshLunagariya HarshLunagariya commented Oct 20, 2024

Description

This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

  1. create schema
  2. create database roles
  3. alter/drop user-defined database roles
  4. manage permissions via grant/revoke statements

Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved

BABEL-5135

Test Scenarios Covered

  • Use case based -

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

tanscorpio7 and others added 27 commits September 25, 2024 09:13
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
Added support for new fixed server role securityadmin. This role has following privileges with it:

Members of the securityadmin fixed server role can manage logins and their properties.
They can GRANT, DENY, and REVOKE server-level permissions.
securityadmin can also GRANT, DENY, and REVOKE database-level permissions if they have access to a database.

Original PR with all the comments babelfish-for-postgresql#2907

Issue resolved: BABEL-5040
Signed-off-by: ANJU BHARTI <[email protected]>
* support db_accessadmin

Signed-off-by: Tanzeel Khan <[email protected]>

* empty commit to rerun actions

Signed-off-by: Tanzeel Khan <[email protected]>

* add basic tests

Signed-off-by: Tanzeel Khan <[email protected]>

* fix get_authid_user_ext_physical_name

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor is_role() & is_user() to one function

Signed-off-by: Tanzeel Khan <[email protected]>

* address comments

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* empty commit to rerun actions

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* add test to upgrade

Signed-off-by: Tanzeel Khan <[email protected]>

* add test to upgrade

Signed-off-by: Tanzeel Khan <[email protected]>

* fix tests

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* empty

Signed-off-by: Tanzeel Khan <[email protected]>

* see dump restore actions logs

Signed-off-by: Tanzeel Khan <[email protected]>

* ssh into github actions host

Signed-off-by: Tanzeel Khan <[email protected]>

* remove temp changes and reset password for login in verify file

Signed-off-by: Tanzeel Khan <[email protected]>

* empty

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor

Signed-off-by: Tanzeel Khan <[email protected]>

* fix tests

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor

Signed-off-by: Tanzeel Khan <[email protected]>

* fix is_member

Signed-off-by: Tanzeel Khan <[email protected]>

* fix is_member

Signed-off-by: Tanzeel Khan <[email protected]>

* fix

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor upgrade function for creating roles

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor

Signed-off-by: Tanzeel Khan <[email protected]>

* fix merge issue

Signed-off-by: Tanzeel Khan <[email protected]>

* refactor name for upgrade function

Signed-off-by: Tanzeel Khan <[email protected]>

* use IS_BBF_BUILT_IN_DB macro in some more places

Signed-off-by: Tanzeel Khan <[email protected]>

* empty

Signed-off-by: Tanzeel Khan <[email protected]>

* fix upgrade file

Signed-off-by: Tanzeel Khan <[email protected]>

* fix typo

Signed-off-by: Tanzeel Khan <[email protected]>

---------

Signed-off-by: Tanzeel Khan <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
@coveralls
Copy link

coveralls commented Oct 21, 2024

Pull Request Test Coverage Report for Build 11581098819

Details

  • 110 of 134 (82.09%) changed or added relevant lines in 6 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 74.517%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/multidb.c 12 13 92.31%
contrib/babelfishpg_tsql/src/hooks.c 29 38 76.32%
contrib/babelfishpg_tsql/src/dbcmds.c 47 61 77.05%
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/dbcmds.c 2 64.17%
Totals Coverage Status
Change from base Build 11517570129: 0.01%
Covered Lines: 45608
Relevant Lines: 61205

💛 - Coveralls

Signed-off-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
Signed-off-by: Harsh Lunagariya <[email protected]>
@@ -1417,12 +1471,14 @@ create_db_roles_in_database(const char *dbname, List *parsetree_list)
int i = 0;
char *db_owner;
char *db_accessadmin;
char *db_securityadmin;

Choose a reason for hiding this comment

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

Nit: Indentation

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Oct 31, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
@tanscorpio7 tanscorpio7 merged commit 531fb1b into server-database-roles-4-x Oct 31, 2024
58 of 92 checks passed
tanscorpio7 pushed a commit that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit that referenced this pull request Oct 31, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
tanscorpio7 pushed a commit that referenced this pull request Nov 1, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
@shalinilohia50 shalinilohia50 deleted the babel_dbsecadmin branch November 4, 2024 08:47
tanscorpio7 pushed a commit that referenced this pull request Nov 5, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Nov 15, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Nov 15, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Nov 20, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit that referenced this pull request Nov 20, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
thephantomthief pushed a commit that referenced this pull request Nov 20, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Dec 5, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Dec 5, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
shardgupta pushed a commit to babelfish-for-postgresql/postgresql_modified_for_babelfish that referenced this pull request Dec 11, 2024
Description
Handle babelfish dump restore changes for fixed database role db_securityadmin
Extension PR : amazon-aurora/babelfish_extensions#70

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
anju15bharti pushed a commit that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
chxwang pushed a commit that referenced this pull request Dec 12, 2024
This commit adds support for db_securityadmin fixed database roles. Members of db_securityadmin can perform following operations within a particular database:

create schema
create database roles
alter/drop user-defined database roles
manage permissions via grant/revoke statements
Engine Changes - amazon-aurora/postgresql_modified_for_babelfish#100

Issues Resolved
[BABEL-5135]

Signed-off-by: Harsh Lunagariya <[email protected]>
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.

6 participants