Add revoke action and YAML support for permission updates#1461
Open
anniegracehu wants to merge 11 commits intocloud-ark:masterfrom
Open
Add revoke action and YAML support for permission updates#1461anniegracehu wants to merge 11 commits intocloud-ark:masterfrom
anniegracehu wants to merge 11 commits intocloud-ark:masterfrom
Conversation
Support permission updates and revocations from both JSON and YAML files, reuse shared parsing/configmap helpers, and extend tests to cover revoke CLI validation and multi-format permission file parsing. Made-with: Cursor
5e4ab35 to
6e0c42b
Compare
Run new update parser in shadow mode behind an env flag and assert old/new parity, with tests validating parser output equivalence. Made-with: Cursor
Inline legacy update parsing in _update_rbac for source-of-truth behavior and keep old/new parity assertions behind KUBEPLUS_UPDATE_EQ_CHECK, while removing extra helper methods. Made-with: Cursor
Use _load_permission_data only in _update_rbac and keep the original rule loop. Drop dual-parser parity and its test. Match _parse_permission_rules to legacy by always appending rule_group. Return early from revoke when no update ClusterRole exists to avoid rewriting perms configmap. Made-with: Cursor
Add _parse_update_rules_legacy for a single legacy implementation, optional KUBEPLUS_UPDATE_EQ_CHECK assertion against _parse_permission_rules in _update_rbac, and a unit test including non-apigroup edge cases. Made-with: Cursor
Remove duplicate _parse_update_rules_legacy and env parity self-check; add a focused test for non-apigroup edge case. Made-with: Cursor
Provide a minimal permissions file to validate update/revoke against an existing service account during manual testing. Made-with: Cursor
Provide three paired examples under tests/permission_files to validate update/revoke behavior with auth can-i for both input formats. Made-with: Cursor
Parse all JSON and YAML fixtures in tests/permission_files through provider-kubeconfig helpers to validate real file-based inputs used in manual update/revoke checks. Made-with: Cursor
Use tests/permission_files fixtures for manual checks and test coverage instead of the old tests/manual file. Made-with: Cursor
Verify update/revoke using matching JSON and YAML permission fixtures produce the same auth can-i transition on an existing service account (deny -> allow -> deny). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
revokeaction toprovider-kubeconfig.pyupdateandrevoke<sa>-permsconfigmap synchronized when updating and revoking permissionsrevokeCLI validation and permission file parsingtests/manual/update-revoke-perms.yamlTest plan
python3 -m unittest tests/test_provider_kubeconfig.pyManual update/revoke e2e (existing SA)
Use an existing service account (example:
argocd-application-controllerinargocd) and verify update/revoke without creating a new SA.