-
Notifications
You must be signed in to change notification settings - Fork 66
enforce country code to be uppercase #320
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
Conversation
correcting Issue #
Resolving issue #319 by enforcing the value to be always uppercase
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.
Thanks @Luci2015 the change looks good (modulo the one comment). But you also need to apply it to the Okta connector. Please sync to the latest v2 and look at directory_okta.py in the connector folder. Thanks!
@@ -269,9 +269,9 @@ def iter_users(self, users_filter, extended_attributes): | |||
if sn_value is not None: | |||
user['lastname'] = sn_value | |||
c_value = LDAPValueFormatter.get_attribute_value(record, six.text_type('c')) | |||
source_attributes['c'] = c_value | |||
source_attributes['c'] = c_value.upper() if c_value else None |
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.
The source_attributes should not be uppercased, because it's supposed to show through the actual source value.
changes applied; also for Okta |
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.
good changes for the most part, but you went one step too far in the Okta case :). Almost there!
else: | ||
source_attributes['countryCode'] = None | ||
source_attributes['countryCode'] = user['country'] = None |
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.
No, the field on the user object is not supposed to be set in this case; only the source object. This line should stay the same.
Sorry, I just thought it was a missed users['country'] assignment to None since, following the logic for source_attributes in directory_ldap file. I did not follow where these variable go after.. |
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.
Looks great! Thanks for the fix!
resolving issue #319
This change is proposed for csv and ldap only.