-
-
Notifications
You must be signed in to change notification settings - Fork 950
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
feat: add API to batch insert identities #3157
Conversation
f13d61a
to
bf3faaf
Compare
Codecov Report
@@ Coverage Diff @@
## master #3157 +/- ##
==========================================
+ Coverage 77.68% 77.92% +0.24%
==========================================
Files 319 320 +1
Lines 20162 20401 +239
==========================================
+ Hits 15663 15898 +235
- Misses 3301 3303 +2
- Partials 1198 1200 +2
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c4d1884
to
fce9933
Compare
18ea1d9
to
b2609f4
Compare
9d20941
to
cd1389d
Compare
cd1389d
to
b45c051
Compare
4f852a6
to
758a567
Compare
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.
Thank you! This looks pretty good already, but I had a hard time understanding how the persister creates the batches. I will need to do another pass.
All new code is tested extensively, because the single-identity create is now a special-case of the multiple-identities create.
Not on my watch ;) This code is essential and has security implications. There can not be confusion of credentials or addresses when creating things in batch. Yet, there is not a single test assuring that we are actually creating things correctly when creating multiple things at once. Please add appropriate tests to prove that your changes work as
expected.
Please add dedicated persister tests and manager tests as well. We will need to use them when adjusting the persister for our enterprise use cases in the Ory Network.
Thanks!
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.
Ok, took another look at the persister itself. I think the code falls into the classic Go "for range over a slice of pointers" trap. I think this could have serious implications when processing 2...n
elements
350f76b
to
2b9bfb0
Compare
96da26f
to
7fff0a0
Compare
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.
Very nice :) One potential test could be added to ensure the merging of verification addresses works correctly :)
d1f29b9
to
6cb43f5
Compare
6cb43f5
to
5d69fd3
Compare
This PR does:
batch.Create
function to create multiple records in one INSERT statementbatch.Create
in creating multiple identities (with up to four individual queries depending on the structure of the identitites)All new code is tested extensively, because the single-identity create is now a special-case of the multiple-identities create.
Related issue(s)
Fixes ory/network#266
Checklist
(Optional:) adddelete
action anddry_run
paramenter