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

Hypercore Secret Key option #27

Closed
urgent opened this issue Oct 28, 2019 · 3 comments
Closed

Hypercore Secret Key option #27

urgent opened this issue Oct 28, 2019 · 3 comments

Comments

@urgent
Copy link

urgent commented Oct 28, 2019

My platform starts up a new container for each build and I keep loosing write permissions.

In the dat-sdk, is it possible to:

I was thinking of something like:

const myArchive = await DatArchive.create({
  title: 'My Archive'
})

const archive = await DatArchive.load(myArchive.url, {secretKey: myArchive.secretKey})

That way, I can set secretKey as an env variable, and maintain write permissions between containers.

@RangerMauve
Copy link
Owner

Would you be comfortable with an API like 'archive.getSecretKey()` which returns a promise?

cc @pfrazee since this might be a divergence from Beaker's API.

@pfrazee
Copy link

pfrazee commented Oct 31, 2019

Sure go ahead

@RangerMauve
Copy link
Owner

Cool, I might get to it next week, but in the meantime a PR with a unit test would be very much welcome. It could look something like

async getSecretKey() {
await this._loadPromise
return this._archive.secretKey
}

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

No branches or pull requests

3 participants