IdentityFeature
The identity of a composable node as a feature (work-placement §WPK-3, §WPI-11).
| Inherits | nodekit::NodeFeature |
In the namespace nodekit. Declared in src/libs/libopalnet/opalnet/features/IdentityFeature.hpp.
Detailed description
Holds the key store and its service, the hive session and the hive registry, and gives first-run provisioning. Needs nothing.
- **Access**: the facilities `keyStoreService`, `session` and `hiveRegistry`. The comms and pairing features read `keyStore()`, `associate()` and `nodeType()` of this feature, because these three say who this node is. - **Lifecycle**: the key store service is on the level `NodeActive`. The hive session is not a service: the app mounts a hive through it (`StartupStateMachine` in a node). - **Proof**: testNodeKit.
What the app tells the feature
A node selects its identity after configure, from its hive, and the identity changes when the person switches it. So the app tells the feature where the identity of now is: `setKeyStoreSource` and `setAssociateSource`. Without a source, the key store is the idle key store of the service and the associate is null. The app also gives the node type before install, because a node knows it only after construction (`Node::nodeType()` is virtual).
The key store, the session and the registry exist from construction, so that `Node` gives them to the services it builds in its constructor. Install configures them.