RBAC: Support system-scoped tokens in pcdctl config/auth#428
Merged
Conversation
tanaypf9
approved these changes
Jun 29, 2026
kgunjikar
approved these changes
Jun 29, 2026
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.
ISSUE(S):
SUMMARY
config setcould only request project-scoped keystone tokens. A system-scopeduser (e.g.
platform_admin, which has only asystem=allrole binding and noproject role) got a 401 at token issuance, before any policy ran — so host
onboarding was impossible for them. Separately, the user identity domain was
hardcoded to
default, so any user outside thedefaultdomain also got a 401and could not authenticate at all.
ISSUE TYPE
-s/-dsystem-scope support; end-user/project-scoped behavior unchanged)GetAuthsignature change breaks downstream importers, e.g. pcdctl, until updated)IMPACTED FEATURES/COMPONENTS:
pkg/keystone—GetAuth(+systemScope,userDomain); newprojects.go/users.go(project name→ID and user default-project lookups)pkg/objects—ConfiggainsSystemScope bool,UserDomain stringpkg/config—validateConfigFields(tenant optional under system scope); suppressservicedefault under-scmd/config.go—-s/--system,-d/--domainflags; 9GetAuthcall sites updated for the new signatureplatform9/pcdctl(importspf9ctl/pkg/keystone) — needs a companion updateTESTING DONE
Automated
pkg/keystone/keystone_scope_test.go(auth-body construction —project/system × mfa × domain, all valid JSON) and
keystone_resolve_test.go(project name→ID, UUID short-circuit, user default-project present/absent).
(no regression for existing users).
go build ./...,go test ./...,go vet ./...,gofmt -sall clean.Manual
Live-validated on a CE DU (
pcd-community.pf9.io) asplatform_admin@pf9.user:config set -s(previously 401) → succeeds; system-scoped token issued.-t→ userdefault_project_id(81ae47…);-t service→ name lookup;-t <uuid>→ short-circuit;-t <nonexistent>→clean "Unable to resolve target project" error (config left untouched).
prep-nodeonboarded a host; resmgr authorized the system-scoped token(GET host → 200; the
pf9-kuberole 404 is a PCD-V DU not offering that role,not an auth failure).
-ddomain handling + default-domain back-compat verified.-s) confirmed unchanged (correct path taken; keystonereturned 401 only on stale test creds, i.e. the body was well-formed).
Before:
After (system scope support):