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

feat: namespaced keychain #428

Merged
merged 8 commits into from
Sep 3, 2020
Merged

feat: namespaced keychain #428

merged 8 commits into from
Sep 3, 2020

Conversation

johnny243
Copy link
Contributor

@johnny243 johnny243 commented Jul 11, 2020

@johnny243 johnny243 marked this pull request as ready for review July 16, 2020 06:29
@johnny243 johnny243 requested review from moughxyz and arielsvg July 16, 2020 06:29
Copy link
Contributor

@arielsvg arielsvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/standardnotes/web/blob/004-namespaced-keychain/app/assets/javascripts/ui_models/application.ts#L59
The WebApplication class still defines the namespace as an empty string. Should it be injected instead?
Also how will the application get the keychainValue from an 003 installation?
I guess if namespace stays an empty string this works with 003 installations but then doesn't achieve namespacing completely.

app/assets/javascripts/interface.ts Outdated Show resolved Hide resolved
@moughxyz
Copy link
Member

I suppose it might make sense to think about how multiple application namespaces would look like. We will need to persist namespaces in localStorage as a top-level key I think (nonwrapped). Then each new application instance would determine its namespace based on the length of existing namespaces.

Something like:

/** Before creating an application */
const namespaces = localStorage.get("namespaces") || [];
const namespace = `application-${namepaces.length}`;

const application = new Application(..., namespace, ...);

@arielsvg
Copy link
Contributor

arielsvg commented Jul 17, 2020

I suppose we can address this when we get to actually run multiple applications at once. I just thought that was the intent of the feature.

@johnny243 johnny243 marked this pull request as draft July 29, 2020 16:48
@johnny243 johnny243 changed the base branch from 004 to develop August 19, 2020 16:35
@johnny243 johnny243 marked this pull request as ready for review August 28, 2020 17:43
@johnny243 johnny243 requested a review from moughxyz September 1, 2020 17:54
@moughxyz moughxyz requested review from arielsvg and removed request for moughxyz September 1, 2020 19:04
Copy link
Contributor

@arielsvg arielsvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the snjs dependency, I'm assuming that's why the type check is failing :)

app/assets/javascripts/services/bridge.ts Outdated Show resolved Hide resolved
app/assets/javascripts/ui_models/application.ts Outdated Show resolved Hide resolved
app/assets/javascripts/web_device_interface.ts Outdated Show resolved Hide resolved
app/assets/javascripts/web_device_interface.ts Outdated Show resolved Hide resolved
app/assets/javascripts/web_device_interface.ts Outdated Show resolved Hide resolved
app/assets/javascripts/services/bridge.ts Outdated Show resolved Hide resolved
app/assets/javascripts/services/bridge.ts Outdated Show resolved Hide resolved
@johnny243 johnny243 requested a review from arielsvg September 2, 2020 16:00
@johnny243 johnny243 merged commit 568fb14 into develop Sep 3, 2020
@johnny243 johnny243 deleted the 004-namespaced-keychain branch September 3, 2020 12:19
@johnny243 johnny243 restored the 004-namespaced-keychain branch September 6, 2020 02:36
@johnny243 johnny243 deleted the 004-namespaced-keychain branch September 6, 2020 02:37
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