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

Integration of NodeConnectionManager for Vaults domain #338

Closed
1 task done
tegefaulkes opened this issue Feb 15, 2022 · 2 comments · Fixed by #266
Closed
1 task done

Integration of NodeConnectionManager for Vaults domain #338

tegefaulkes opened this issue Feb 15, 2022 · 2 comments · Fixed by #266
Assignees
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management

Comments

@tegefaulkes
Copy link
Contributor

tegefaulkes commented Feb 15, 2022

Specification

The VaultManager should be able to use the NodeConnectionManager to receive connections.

We have 2 choices as to how to do this. Either by composition or encapsulation.

In composition, methods of VaultManger expect the caller to produce a node connection to be passed in to do the work against.

In encapsulation, VaultManager takes the NodeConnectionManager, and creates its own connections internally to use.

Either way, they will end up using NodeConnectionManager.withConn.

Refer to #225 as to how to do this.

If we choose to do composition, the job of composition is in our service handlers.

If we choose to do encapsulation, then it's all bundled inside VaultManager.

Composition is fundamentally more flexible, it allows the orchestrators/service handlers to potentially coordinate over multiple nodes when performing operations. It is more future proof. If we do this, we should extend the model to other managers like NotificationManager later.

Currently this is using the encapsulation style. The VaultManager holds a reference to the NodeConnectionManager and passes it to the two VaultInternal functions that specifically need it.

                       ┌───────────────────────┐            ┌─────────┐
┌─────────────┐        │                       ◄────────────┤Discovery│
│             │        │ NodeConnectionManager │            └─────────┘
│ NodeManager ├────────►                       │
│             │        │     ┌─────────────┐   │       ┌────────────────────┐
│ ┌─────────┐ │        │    ┌┴────────────┐│   ◄───────┤NotificationsManager│
│ │NodeGraph├─┼────────►  ┌─┴────────────┐├┘   │       └────────────────────┘
│ └─────────┘ │        │  │NodeConnection├┘    │
│             │        │  └──────────────┘     │           ┌────────────┐
└─────────────┘        │                       ◄───────────┤VaultManager│
                       └───────────────────────┘           └────────────┘

Additional context

Tasks

  • 1. Vaults domain sould use the new NodeConnectionManager API.
@tegefaulkes
Copy link
Contributor Author

We will need to make a decision between using composition or encapsulation before I can expand this out more. I'm leaning towards encapsulation but I'll do some review on where the connections are used.

@tegefaulkes
Copy link
Contributor Author

This has been addressed. The NodeConnectionManager is encapsulated by the VaultManager and passed to certain VaultInternal' functions where needed. In this case that would be VaultInternal.cloneVaultInternal(), VaultInternal.pull()andVaultManager.scanNodeVaults()`.

@teebirdy teebirdy added the r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management
2 participants