feat(3058): Allow overriding decryption keys on keys* methods, add createLockbox method to team, add self-assign role method#18
Conversation
packages/auth/src/team/Team.ts
Outdated
|
|
||
| /** Give yourself a role */ | ||
| public addMemberRoleToSelf = (roleName: string, decryptionKeys: KeysetWithSecrets) => { | ||
| assert(this.selfAssignRoles.includes(roleName), `Cannot self-assign role ${roleName}`) |
There was a problem hiding this comment.
I think this is the wrong place to do this. This is essentially trusting people to self moderate. I think the correct place to do this is in membershipResolver:membershipRules so that peers can enforce the rules themselves and throw out invalidated links.
There was a problem hiding this comment.
I'm gonna do it there, too, that piece is just more complicated and this blocks the lockbox creation, too.
There was a problem hiding this comment.
I wanted to take more time to look at the implications of blocking updates to the chain on these sorts of checks but didn't wanna delay being able to test self-assigns.
There was a problem hiding this comment.
Added a check against this list to the validator as well which will reject the link if the role isn't self-assignable. I'm still doing the check in team but now it will properly reject when other user's get the update.
375c8ec to
9997e86
Compare
No description provided.