lorawan-stack icon indicating copy to clipboard operation
lorawan-stack copied to clipboard

Refactor Identity Server Store interfaces

Open htdvisser opened this issue 2 years ago • 1 comments

Summary

It would be good to make some changes to some Identity Server Store interfaces to make methods more "single-purpose".

Current Situation

  • The SetMember method of the MembershipStore interface deletes a collaborator when passing zero rights.
  • The UpdateAPIKey method of the APIKeyStore interface deletes an API key when passing zero rights.
  • The Validate method of the ContactInfoStore does multiple things that should be "business logic" instead of "store logic":
    • Getting a ContactInfoValidation
    • Checking for already used / expired
    • Marking ContactInfo as "validated"
    • Validating the primary email address of a user
    • Marking the ContactInfoValidation as "used"
  • Similarly for the SetInvitationAcceptedBy method of the InvitationStore

Desired Situation

  • The MembershipStore interface should have separate methods for updating and deleting collaborators.
  • The APIKeyStore interface should have separate methods for updating and deleting API keys.
  • The ContactInfoStore should have separate methods for each of the tasks described above. Other business logic belongs in the RPC implementation.
  • Similar story for the InvitationStore.

Code of Conduct

htdvisser avatar Jul 11 '22 12:07 htdvisser

Blocked on #3250, so for triage let's just assign someone, and maybe schedule it for Q4 or so.

cc: @NicolasMrad

htdvisser avatar Jul 11 '22 12:07 htdvisser

What is the status here ?

I saw that we have a branch already, and I am wondering how much is left in order to schedule this for review and merging.

adriansmares avatar May 23 '23 14:05 adriansmares

It was supposed to be finished on the Thursday two weeks ago but didn't managed to do it. I'm pretty confident in finishing this Thursday.

nicholaspcr avatar May 23 '23 14:05 nicholaspcr

This was actually finished on v3.26.1 the related RPC implementation is the continuation based on the addition of the delete methods in the interfaces.

Therefore I'll be closing this issue.

nicholaspcr avatar Jun 12 '23 11:06 nicholaspcr