Skip to content
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

Merged
merged 4 commits into from
Aug 17, 2023
Merged

Update tenant-gate.ts #475

merged 4 commits into from
Aug 17, 2023

Conversation

nearlyjuly
Copy link
Contributor

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)

Adding a custom tenantgate option to support any tenant list checking function that returns a boolean value
@nearlyjuly nearlyjuly marked this pull request as ready for review August 16, 2023 15:07
diehuxx
diehuxx previously approved these changes Aug 16, 2023
Copy link

@diehuxx diehuxx left a 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.

@diehuxx diehuxx dismissed their stale review August 16, 2023 21:49

woops just meant to comment, not approve

Copy link

@diehuxx diehuxx left a 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

@thehenrytsai thehenrytsai merged commit d793c8a into decentralized-identity:main Aug 17, 2023
@nearlyjuly nearlyjuly deleted the customtenantgateoption branch August 17, 2023 14:56
diehuxx pushed a commit that referenced this pull request Aug 18, 2023
* main:
  Update tenant-gate.ts (#475)
  Data below a threshold should not be stored in DataStore. (#456)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants