-
Notifications
You must be signed in to change notification settings - Fork 105
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
Update tenant-gate.ts #475
Update tenant-gate.ts #475
Conversation
Adding a custom tenantgate option to support any tenant list checking function that returns a boolean value
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.
Thanks for the contribution @nearlyjuly ! You're right that we don't provide any explanation for custom tenant gating as far as I can find. I think a better place to provide an example is in the README. I'll push a commit to this PR in just a sec.
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.
thanks @thehenrytsai for the update
The list of tenant DIDs for a DWN may be anything from single figures to many hundreds (perhaps thousands?). It's likely that there will be a custom solution to manage large numbers in particular, to set permissions or create a tenant removal process. This draft PR is a suggestion to make this a little easier, by having a custom tenantGate that can be set using
tenantGate : new ExternalTenantGate(externalTenantCheck)
when initialising the DWN instance.This would make it straightforward to pass in a function that checks if the DID is a tenant in any way, so long as the response is true or false.
Although it is straightforward to create a custom tenantGate, I feel this is a simple way to convey what is needed if someone is unfamiliar with this project.
(If this is not a massive issue then I'll delete)