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

fix for partial birthdates #4369

Merged
merged 3 commits into from
Jun 9, 2020
Merged

Conversation

ericbuckley
Copy link
Contributor

it's possible that only a partial birthdate will comeback from the SSOe
SAML response, for example the MVI record may only have the user's birth
year and not the month or day. When we only have a partial birth date
we should return nil.

fixes: http://sentry.vfs.va.gov/vets-gov/platform-api-production/issues/130015/

its possible that only a partial birthdate will comeback from the SSOe
SAML response, for example the MVI record may only have the user's birth
year and not the month or day.  When we only have a partial birth date
we should return nil.

fixes: http://sentry.vfs.va.gov/vets-gov/platform-api-production/issues/130015/
Copy link
Contributor

@hinzed1127 hinzed1127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@va-vfs-bot va-vfs-bot temporarily deployed to eb-fix-ssoe-birthdate-parsing/master June 9, 2020 16:14 Inactive
Copy link
Contributor

@thilton-oddball thilton-oddball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@omgitsbillryan omgitsbillryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example the MVI record may only have the user's birth year and not the month or day.

How common is this? Is there any merit to trying to salvage what we do get back from mvi as opposed to returning nil?

LGTM either way, but wondering what the consequences of this are.

@ericbuckley
Copy link
Contributor Author

for example the MVI record may only have the user's birth year and not the month or day.

How common is this? Is there any merit to trying to salvage what we do get back from mvi as opposed to returning nil?

LGTM either way, but wondering what the consequences of this are.

Over the past 6 days, we've seen it happen once over the ~1900 authentication requests we processed, so it's not common.

As for returning the data we have, I opted to return nil because I thought it would be safer that way. If we return a year, and the FE application somewhere assumes this value is a date, I thought that might raise an error. However, I have little context for knowing where on the FE this value is used, so if someone knows more about this I'd be open to returning a difference value.

@omgitsbillryan
Copy link
Contributor

I think nil is the safe way to go. I might even argue for some kind ActiveModel::Validations code to validate incoming data from MVI - but that's outside the scope of your PR here.

@ericbuckley ericbuckley merged commit 4ee4273 into master Jun 9, 2020
@ericbuckley ericbuckley deleted the eb-fix-ssoe-birthdate-parsing branch June 9, 2020 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants