fix(auth): infer actor type from preferred_username on JIT provision - #31
Conversation
PR Summary by QodoFix JIT actor type inference for Keycloak service accounts
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
|
Thanks for the review. Fixed the actor type inference issue in cbcb814 - all tests pass. |
JIT-provisioned actors were hardcoded to ActorTypeHuman; now inferActorType() detects Keycloak's service-account- username prefix to correctly type service accounts; includes a doc comment on inferActorType noting known heuristic limitations (tracked in FLPATH-4479 and FLPATH-4415). Signed-off-by: Chad Crum <1462069+chadcrum@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com>
d407afc to
33448d7
Compare
Summary
ActorTypeHumanregardless of their actual typepreferred_username=service-account-<client-id>- now we detect and type them asActorTypeServiceAccountinferActorType()helper that checks for theservice-account-prefix and returns the correct typeprovisionActor()to use inferred type instead of hardcoding, and addedactorTypeto structured logsVerification
type=service_accountin the DB against a live Keycloak + DCM stackTestResolveActor_JITProvisionServiceAccount(end-to-end through mock store) andTestInferActorType(table-driven, 8 cases covering prefix match, case sensitivity, and edge cases)