NodeRegistrationHandler typedef
NodeRegistrationHandler =
Future<Map<String, dynamic> > Function(NodeDescriptor descriptor, Map<String, dynamic> payload, Principal? principal)
Decides whether a node registration is accepted, and what to send back.
Called on NodeRegister before the node enters the registry. Return the
payload for the NodeRegistered ack (const {} for none) — this is where an
application enrols the node: validate its NodeRegister.payload (a CSR, an
enrolment secret), and hand back what it needs (a signed certificate, a
lease).
Throw a HubException to reject: the hub replies NodeErrorMessage and closes the connection without registering.
Implementation
typedef NodeRegistrationHandler =
Future<Map<String, dynamic>> Function(
NodeDescriptor descriptor,
Map<String, dynamic> payload,
Principal? principal,
);