Skip to content
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

Update logging to reflect accurate user key #363

Closed
adorton-adobe opened this issue Jun 13, 2018 · 3 comments · May be fixed by #826
Closed

Update logging to reflect accurate user key #363

adorton-adobe opened this issue Jun 13, 2018 · 3 comments · May be fixed by #826
Assignees
Labels

Comments

@adorton-adobe
Copy link
Collaborator

The user key used in certain log entries reflects the directory user record. Elements of the key - username, domain, email - can be updated by the after_mapping_hook. When any key element is updated, the key used in log messages is not updated. This can cause confusion - see #362.

Before writing the key to the logger, we should update it to reflect the umapi record. We don't necessarily need to update the key itself, which is used in internal data structures. At the very least, we should modify its representation when adding it to logs (perhaps with a new lookup table).

@adorton-adobe adorton-adobe added this to the 2.4 milestone Jul 26, 2018
@adorton-adobe adorton-adobe modified the milestones: v2.4, v2.4.1 Jan 24, 2019
@adorton-adobe
Copy link
Collaborator Author

@shasibhusanJena FYI - the links here and in the linked issue that point to specific lines in the source code are out of date.

@shasibhusanJena
Copy link
Contributor

oh ok. help me how can I produce same bug while running on my local
do I have to enable extension-config.yml to reproduce this change with below lines enabled under after_mapping_hook: |

if below changes I do have to enable to see this error on my local
student_email = source_attributes.get('OCADstudentEmail')
if student_email is not None:
target_attributes['email'] = student_email
target_attributes['domain'] = student_email.split("@")[1]
print(source_attributes)
print(target_attributes)

@shasibhusanJena
Copy link
Contributor

shasibhusanJena commented Feb 11, 2019

I feel this is what we are trying to find out why this key getting 'none'

ex:
{'email': '[email protected]', 'identity_type': None, 'username': 'user123', 'domain': None, 'givenName': 'User', 'sn': '123', 'c': 'CA', 'OCADstudentEmail': '[email protected]'}

2019-02-11 21:19:04 17504 DEBUG processor - Source attrs, before: {'email': '[email protected]', 'identity_type': None, 'username': None, 'domain': None, 'givenName': 'deepak', 'sn': 'kumar', 'c': None, 'bc': None, 'subco': None}

Need to check why identity_type and domain name setting to "None" instead of printing correct value
i believe have to work on one of them listed below
after_mapping_hook_scope['source_attributes'] or after_mapping_hook_scope['target_attributes']
or def log_after_mapping_hook_scope(self, before_call=None, after_call=None):
@adorton-adobe please correct me if my understnading is wrong.

@adorton-adobe adorton-adobe modified the milestones: v2.4.1, v2.5 Apr 3, 2019
@adorton-adobe adorton-adobe removed this from the v2.5.0 milestone May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants