miltador / AspNetCore.Identity.DynamoDB

DynamoDB Data Store Adaptor for ASP.NET Core Identity
MIT License
35 stars 23 forks source link

add role stores #2

Closed cmsd2 closed 7 years ago

cmsd2 commented 7 years ago
  1. add a role table, and a join table between roles and users, and the stores to manage them.
  2. added tests for role table store and join table.
  3. stopped using NewTableName + table alias in tests -- the alias created in the context doesn't seem to be isolated to the test that needs it so it affects later tests.

have got some duplicate protection on the join table, but not on the roles table itself.

also seem to be getting a conditional update failure in deletion of a role. can't quite figure out why.

miltador commented 7 years ago

@cmsd2, awesome work! Will have a closer look soon.

About tests: tests run in parallel so two or more tests are trying to create roleUsers table. The aliases are set globally for all tests. I ran into issue recently due to table names were too short and luckily NewTableName gave same values so I increased the length to 15. So basically if table names are generated unique enough, there would be no issues in creating a table per test.

miltador commented 7 years ago

@cmsd2, I merged your changes and just fixed the unresolved issues you mentioned. Hope you won't resist on it as I aim to start testing it in production and hopefully reach 1.0.0 stable release some day. 7632c55499e3df79b138511ecdee95c41f1ba75b: the problem with deletion of a role record was due to DeletedOn attribute was a range key.

cmsd2 commented 7 years ago

fantastic. thanks for helping fix those problems.