Skip to content

Commit e7d0aa7

Browse files
authored
Add more traits if they exist. (#32)
Add login, mfa status, and user icon if they exist.
1 parent 3d5f164 commit e7d0aa7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/connector/user.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ func userResource(ctx context.Context, user *github.User, userEmail string, extr
5555
userTrait = append(userTrait, resource.WithEmail(email, false))
5656
}
5757

58+
if user.GetAvatarURL() != "" {
59+
userTrait = append(userTrait, resource.WithUserIcon(&v2.AssetRef{
60+
Id: user.GetAvatarURL(),
61+
}))
62+
}
63+
if user.GetLogin() != "" {
64+
userTrait = append(userTrait, resource.WithUserLogin(user.GetLogin()))
65+
}
66+
if user.TwoFactorAuthentication != nil {
67+
userTrait = append(userTrait, resource.WithMFAStatus(&v2.UserTrait_MFAStatus{
68+
MfaEnabled: user.GetTwoFactorAuthentication(),
69+
}))
70+
}
71+
5872
ret, err := resource.NewUserResource(
5973
displayName,
6074
resourceTypeUser,

0 commit comments

Comments
 (0)