Skip to content

Commit

Permalink
Add clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkats-db committed Sep 13, 2024
1 parent 1e8ec00 commit fcabb88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/auth/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
func GetShortUserName(user *iam.User) string {
var name string
if IsServicePrincipal(user.UserName) {
// Try use the display name of the principal (if it has one)
name = user.DisplayName
}
if name == "" {
Expand Down
2 changes: 1 addition & 1 deletion libs/auth/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestGetShortUserName(t *testing.T) {
{
user: &iam.User{
UserName: `1706906c-c0a2-4c25-9f57-3a7aa3cb8123`,
// No DisplayName
// This service princpal has DisplayName (it's an optional property)
},
expected: "1706906c_c0a2_4c25_9f57_3a7aa3cb8123",
},
Expand Down

0 comments on commit fcabb88

Please sign in to comment.