Skip to content

Commit ab1f7cc

Browse files
committed
feat: implement multiple token support and token management
Added new pages for join token management. The token can be created, revoked and deleted. Also support tokens with the expiration. Introduced new resources: - `JoinToken` - keeps the token, it's ID is the token string. - `JoinTokenStatus` - is generated by the controller, it calculates the information about the current token state: active, revoked or expired. And also has the information about if the token is default. - `DefaultJoinToken` - is the singleton resource that keeps the current default token id. The behavior of siderolink manager was changed to create a default `JoinToken` resource out of whatever is currently stored in the `siderolink.Config` resource. `siderolink.ConnectionParams` is now generated by the controller. It's using the default token from the `DefaultJoinToken` resource. Infra providers will get their own unique tokens, but they won't use it until the library is updated. So they will still rely on the default join token until updated. Dropped `siderolink.ConnectionParams` usage in most of the places. This resource is kept only for the backward compatibility reasons. Fixes: #907 Signed-off-by: Artem Chernyshev <[email protected]>
1 parent 0e76483 commit ab1f7cc

File tree

75 files changed

+4875
-869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4875
-869
lines changed

client/api/omni/management/management.pb.go

Lines changed: 246 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/management/management.pb.gw.go

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/management/management.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ message CreateSchematicRequest {
138138
string media_id = 5;
139139
bool secure_boot = 6;
140140
SiderolinkGRPCTunnelMode siderolink_grpc_tunnel_mode = 7;
141+
string join_token = 8;
141142
}
142143

143144
message CreateSchematicResponse {
@@ -200,13 +201,27 @@ message MaintenanceUpgradeResponse {
200201

201202
message GetMachineJoinConfigRequest {
202203
bool use_grpc_tunnel = 1;
204+
string join_token = 2;
203205
}
204206

205207
message GetMachineJoinConfigResponse {
206208
repeated string kernel_args = 1;
207209
string config = 2;
208210
}
209211

212+
message GenJoinTokenResponse {
213+
string token = 1;
214+
}
215+
216+
message CreateJoinTokenRequest {
217+
string name = 1;
218+
google.protobuf.Timestamp expiration_time = 2;
219+
}
220+
221+
message CreateJoinTokenResponse {
222+
string id = 1;
223+
}
224+
210225
service ManagementService {
211226
rpc Kubeconfig(KubeconfigRequest) returns (KubeconfigResponse);
212227
rpc Talosconfig(TalosconfigRequest) returns (TalosconfigResponse);
@@ -225,4 +240,5 @@ service ManagementService {
225240
rpc ReadAuditLog(ReadAuditLogRequest) returns (stream ReadAuditLogResponse);
226241
rpc MaintenanceUpgrade(MaintenanceUpgradeRequest) returns (MaintenanceUpgradeResponse);
227242
rpc GetMachineJoinConfig(GetMachineJoinConfigRequest) returns (GetMachineJoinConfigResponse);
243+
rpc CreateJoinToken(CreateJoinTokenRequest) returns (CreateJoinTokenResponse);
228244
}

client/api/omni/management/management_grpc.pb.go

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)