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

fix: fixes for database role grants #193

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rcohngru-ab-carval
Copy link
Contributor

  • updates the behavior of the fetch_database_role_grant function to mimic the behavior of fetch_role_grant in the data provider
    • accounts for differing parameters needed for database role grants
  • updates the behavior of the _resources_from_database_role_grants_config function in gitops to account for database role grants to other database roles

Hey @teej I have one more for you. Was running into some trouble with database role grants and I think this is the culprit. To be quite honest, I didn't spend much time reading into this. I popped the code from the fetch_role_grant function into this one and just updated the code where needed to reflect the difference for database roles, and it worked for my use case.

In case you're interested in reproducing the problem I had:

database_role_grants:
  - database_role: example_db.example_db_role
    to_role: example_role_1
  - database_role: example_db.example_db_role
    to_role: example_role_2

If you perform the above grants by hand, then run Titan, it will attempt to update the grant for example_role_2 from example_role_1 to example_role_2.

While testing the above behavior with grants to database roles, I stumbled across another error, which is that if your config is exclusively database role grants to other database roles, they are not correctly parsed. The change I made in the gitops.py file addresses that issue.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
titan/data_provider.py 0.00% 18 Missing ⚠️
titan/gitops.py 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
titan/gitops.py 54.01% <0.00%> (-12.65%) ⬇️
titan/data_provider.py 12.28% <0.00%> (-70.50%) ⬇️

... and 42 files with indirect coverage changes

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.

1 participant