-
Notifications
You must be signed in to change notification settings - Fork 275
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
azuredevops_identity_user
- validateIdentityUser based on CustomDisplayName userName(search criteria) match
#1072
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Dear, @leasley199, Please take a look:) |
makes sense, based on the user backend configuration there are cases where customDisplayName is not defined but would work and nice little improvement. I think you just need to knock out the CLA requirement and pass the unit/test cases. good luck :) |
@microsoft-github-policy-service agree |
azuredevops_identity_user
- validateIdentityUser based on CustomDisplayName userName(search criteria) match
@@ -101,7 +103,9 @@ func flattenIdentityUsers(users *[]identity.Identity) (*[]identity.Identity, err | |||
// Filter results to validate user is correct. Occurs post-flatten due to missing properties based on search-filter. | |||
func validateIdentityUser(users *[]identity.Identity, userName string, searchFilter string) *identity.Identity { | |||
for _, user := range *users { | |||
if strings.Contains(strings.ToLower(*user.ProviderDisplayName), strings.ToLower(userName)) { | |||
if strings.Contains(strings.ToLower(*user.ProviderDisplayName), strings.ToLower(userName)) || strings.Contains(strings.ToLower(*user.CustomDisplayName), strings.ToLower(userName)) { // It might be the match is based on CustomDisplayName |
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.
if strings.Contains(strings.ToLower(*user.ProviderDisplayName), strings.ToLower(userName)) || strings.Contains(strings.ToLower(*user.CustomDisplayName), strings.ToLower(userName)) { // It might be the match is based on CustomDisplayName | |
if user.ProviderDisplayName != nil && strings.Contains(strings.ToLower(*user.ProviderDisplayName), strings.ToLower(userName)) { | |
return &user | |
} | |
if user.CustomDisplayName != nil && strings.Contains(strings.ToLower(*user.CustomDisplayName), strings.ToLower(userName)) { | |
return &user | |
} |
@yavasura @leasley199 a few changes requested. Need check the values before using it in case for nil exception |
All Submissions:
What about the current behavior has changed?
Issue Number:
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information
@microsoft-github-policy-service agree