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

Private Modules #7

Open
maximousblk opened this issue Oct 20, 2020 · 2 comments
Open

Private Modules #7

maximousblk opened this issue Oct 20, 2020 · 2 comments

Comments

@maximousblk
Copy link
Member

maximousblk commented Oct 20, 2020

Private modules

Because of the nature of arweave, we cannot "hide" the data. The option left is encrypting the data. furthermore we can push the data to arweave in multiple pieces making it harder to put together the encrypted data.

Publishing

  • User sets private: true in config while creation
  • User runs nest publish <version>
  • Nest CLI uploads the tarball
  • Backend encrypts the tarball contents
  • Backend uploads the encrypted tarball contents to arweave

Using

  • Set DENO_AUTH_TOKENS to <api_key>@nest.land (nest switch would handle this env var)
  • User runs deno cache/deno run
  • Deno sends a GET request with the active account's access token using Authorization: bearer <api_key> header
  • Backend fetches the requested file from arweave and decrypts it
  • Backend returns the unencrypted file to Deno
  • Deno caches the fetched file.

Notes

  • private modules probably will also be accessible using an ?auth=<token> query to access from the browser.
  • ?auth=<token> takes precedence over the Authorization header.
@maximousblk
Copy link
Member Author

relevant deno issue: denoland/deno#5239

@maximousblk
Copy link
Member Author

Updated to comply with denoland/deno#9508

@maximousblk maximousblk moved this to RFC in rewrite Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: RFC
Development

No branches or pull requests

1 participant