data-dot-all / dataall

A modern data marketplace that makes collaboration among diverse users (like business, analysts and engineers) easier, increasing efficiency and agility in data projects on AWS.
https://data-dot-all.github.io/dataall/
Apache License 2.0
236 stars 82 forks source link

[Bugfix] - Changes in logic to delete share db #1706

Open TejasRGitHub opened 1 week ago

TejasRGitHub commented 1 week ago

Feature or Bugfix

Detail

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on OWASP 10.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

TejasRGitHub commented 1 week ago

Test cases:

Onboarded two dataset ( D1, D2 ) with the same common_db. Onboarded a consumption role ( C1 ). Environment has two roles ( Scientist, Engineers )

Scenerio 1:

  1. Created a share S1 with table from C1 to D1 ✅ ( Checked if the tables are accessible via Athena )
  2. Created a share S2 with table from C1 to D2 ✅ ( Checked if the tables are accessible via Athena )
  3. Revoked share S2 and checked if the common_db_shared still exists in the account ✅
  4. Queried tables from S1 to validate access and also checked if LF permissions for the principal exists ✅

Scenario 2:

  1. Repeated steps 1 and 2.
  2. Created another share S3 with D1 from environment role : Scientist
  3. Checked if access to the table exists for this role ✅
  4. Now revoked S1 and check if the access in S3 and S2 are intact ✅ ( Checked that the permission to the principals exists and Athena query works)
  5. Revoked S3 and checked if the access to S2 is present ✅ ( Checked that the permission to the principals exists and Athena query works)
  6. Revoked S2 and checked now that the shared database is deleted ✅

TODO Scenario 3:

  1. Repeat steps 1 and 2,
  2. Onboard another dataset (D3) in another enviironment where the database name is the same i.e. common_db
  3. Now make a share S1 from C1 to this dataset ( D3 ) and also make a share S2 with D2 or D1
  4. Revoke share items in share S2 and check if the common_shared db is still present.