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 criteria for valid user data #1108

Merged
merged 7 commits into from Oct 12, 2020

Conversation

ahaurat
Copy link
Contributor

@ahaurat ahaurat commented Oct 2, 2020

Fixes #1107 to allow username or email to identify a user in addition to id or ip_address.

Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR; please add at least a test and a changelog entry.

@ste93cry
Copy link
Collaborator

ste93cry commented Oct 6, 2020

@ahaurat after the answer of @kamilogorek in the referenced issue, there is some more work to do, if you are willing to contribute it. We should:

  • deprecate the static named constructors which only purpose was to ensure that the object was created in a consistent state with the minimum amount of required information
  • remove all validation logic that assumes that either the ID or the IP address fields must be set
  • make the constructor public and add all the arguments to it

In the next major version considering that none of the attributes of the UserDataBag class is required we can probably replace its usages with a simple plain array

@stayallive
Copy link
Collaborator

stayallive commented Oct 9, 2020

@ahaurat I hope you don't mind me jumping in making changes so we can push this over the finish line 👍

After a discussion with @ste93cry we've decided to not deprecate the static named constructors yet, we might do that later and just keep them as nice ways to quickly construct a user data bag.

@ahaurat
Copy link
Contributor Author

ahaurat commented Oct 10, 2020

@stayallive no problem at all; thanks for tackling it. Apologies I didn't have time to get to it this week.

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.

Identifying User by username produces an Error
4 participants