feat: regenerate protos + federation client methods
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
Regenerate the Dart bindings from the platform protos (now including fai/v1/federation.proto and the IssueBootstrapToken / ListSatellites HubAdmin RPCs + the new primary_ca_pem field). Add HubClient wrappers: listSatellites() and issueBootstrapToken(name, region, ttl), the latter returning the primary CA so callers can bootstrap a satellite in one step. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
35a8ee2844
commit
9c0d461fb7
8 changed files with 3807 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:grpc/grpc.dart' as grpc;
|
||||
import 'package:grpc/grpc_connection_interface.dart';
|
||||
|
||||
|
|
@ -139,6 +140,30 @@ class HubClient {
|
|||
return r.capabilities;
|
||||
}
|
||||
|
||||
/// Federation satellites currently connected to this hub
|
||||
/// (primary side). Empty when none are connected or this hub does
|
||||
/// not accept satellites.
|
||||
Future<List<pb.SatelliteEntry>> listSatellites() async {
|
||||
final r = await _admin.listSatellites(Empty());
|
||||
return r.satellites;
|
||||
}
|
||||
|
||||
/// Issue a single-use federation bootstrap token enrolling
|
||||
/// `satelliteName`. The response also carries the primary's CA
|
||||
/// certificate so the operator can install token + CA on the
|
||||
/// satellite in one step (secure first connect).
|
||||
Future<pb.IssueBootstrapTokenResponse> issueBootstrapToken(
|
||||
String satelliteName, {
|
||||
String region = '',
|
||||
int ttlSeconds = 0,
|
||||
}) {
|
||||
final req = pb.IssueBootstrapTokenRequest()
|
||||
..satelliteName = satelliteName
|
||||
..region = region
|
||||
..ttlSeconds = Int64(ttlSeconds);
|
||||
return _admin.issueBootstrapToken(req);
|
||||
}
|
||||
|
||||
/// Detailed info for one installed module: name, version,
|
||||
/// provided capabilities, declared permissions, on-disk path.
|
||||
Future<ModuleInfoResponse> moduleInfo(String moduleName) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue