-
Notifications
You must be signed in to change notification settings - Fork 2
Fix Heimdall principal claims pattern for client IDs (LFXV2-922) #32
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,7 +459,7 @@ func TestAuthRepository_HelperMethods(t *testing.T) { | |
|
|
||
| t.Run("isMachineUser", func(t *testing.T) { | ||
| // Test machine user | ||
| result := repo.isMachineUser(constants.MachineUserPrefix + "test-machine") | ||
| result := repo.isMachineUser("test-machine" + constants.MachineUserSuffix) | ||
|
||
| assert.True(t, result) | ||
|
|
||
| // Test regular user | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change to suffix-based machine user detection, machine user principals now follow the pattern
{client_id}@clients. However, thesafePrincipalLogfunction treats any string containing@as an email address and redacts it to{prefix}@***. This means machine user principals will be logged as{client_id}@***instead of showing the full identifier.Consider updating the
safePrincipalLogfunction to check if a principal is a machine user (usingisMachineUser()) before applying email redaction logic, since machine user identifiers are not personal information and should be logged in full for debugging purposes.