Conversation
awilfox
left a comment
There was a problem hiding this comment.
This looks great and should help with debugging AP-583 as well. r+ after tiny question.
app/models/user.rb
Outdated
| # list all keys except duo keys | ||
| def list_auth_extra_keys(auth_extra) | ||
| keys = auth_extra.keys.reject { |k| k.start_with?('duo') }.sort | ||
| Rails.logger.info("CalNet auth_extra keys: #{keys.join(', ')}") |
There was a problem hiding this comment.
Since this value is already being logged above (line 76), does it need to be logged here as well?
awilfox
left a comment
There was a problem hiding this comment.
Ah, sorry, I didn't see the test failures. Looks like Rubocop has some suggestions, and we need to fix up the mock user objects in the other tests to have the required attributes. Still, I approve of the overall work - just need to fix those issues before merging.
anarchivist
left a comment
There was a problem hiding this comment.
agreed with @awilfox - this is looking good, but let's address the test failures before moving forward.
|
I added For the student ID value, since there is no However, after further review, I think we should not introduce a fallback for the If this is the case, a student might also not have an It seems we need a sample CalNet response for an actual student account to clarify the expected attributes. Based on that, we can decide how to properly update the current validation logic for studentID and employeeID, or we just eliminate to validate related attributes: I will rebase locally to fix the conflict tomorrow. |
|
@yzhoubk I agree that we should gather a real CalNet student response, anonymise it, and then use it as part of our testing. It would be beneficial to have both a student employee and a student non-employee to see how The overall direction of this MR looks good. I will review it in-depth when you are ready. |
|
The PR isn’t ready for review yet — I’m planning to refactor and restructure some of the code . |
During Rails upgrade code review testing, we discovered users were missing email addresses. Investigation showed that a CalNet schema attribute had been renamed, though we were not notified when the change occurred. This ticket aims to address unexpected attribute changes from CalNet and improve our handling of schema updates.