Skip to content

add sync option - #13

Merged
tomas-villagesql merged 1 commit into
mainfrom
tomas/revoke-grant
Sep 23, 2026
Merged

tomas-villagesql merged 1 commit into
mainfrom
tomas/revoke-grant

Conversation

@tomas-villagesql

Copy link
Copy Markdown
Member

No description provided.

@village-tom
village-tom self-requested a review September 22, 2026 12:23

@village-tom village-tom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good, just one doc comment and questions about the python script and keys.

Comment thread README.md
Comment on lines +379 to +387
- `SYNC`: the token's roles become the account's **exact** granted set — grant
the ones it lacks **and revoke every other role it holds that the token did
not claim** (a token carrying no roles revokes them all). This makes the
token issuer the sole source of truth for the account's roles, so a role a
DBA granted out of band is revoked on the next login too. Use it only where
that is the intent. **Exception:** an account's **default roles** (set by an
operator with `ALTER USER … DEFAULT ROLE`) are never revoked — a deliberate
operator pin outranks the token. (An auto-created account has no default
role, so this only shields defaults an operator set explicitly.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also mention here that if a role is revoked mid-session it may cause unexpected behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can add a test, but this is generic behavior if an admin decides to revoke a role, so nothing specific related to this work per se

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's fair enough, although I think a DB admin would be more cognizant of revoking a role directly on the database, and somebody updating IdP config might not think it through in the same way. Though if nothing happens to existing sessions then we can leave the documentation as-is.

@@ -0,0 +1,192 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why was this added in this PR? Is it supposed to be run manually, or during CI?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it has nothing to do with this PR, I just discovered I had them and figured I would add them, I can do a separate PR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah let's do a separate PR if this has nothing to do with the sync option, I'm still unclear on what this script is used for

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need these private keys committed to the repo? They don't present a security risk but they may be flagged in the future. How much work would it be to generate them on the fly instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it has nothing to do with this PR, I just discovered I had them and figured I would add them, I can do a separate PR

@tomas-villagesql
tomas-villagesql merged commit 1c1e2c2 into main Sep 23, 2026
5 of 6 checks passed
@tomas-villagesql
tomas-villagesql deleted the tomas/revoke-grant branch September 23, 2026 15:06
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants