Skip to content

Commit a280f1d

Browse files
author
Ben Anson
committed
CP-36097 REQ-403 add pems to cluster config
Motivation: if we add a 'pems' field to the cluster config, each cluster member will know about a common pem file, and they can use this to perform certificate checking The 'blobs' field is a list, so that a cluster can trust multiple certificates at the same time. This may be helpful in the future if we need to implement certificate rotation inside a cluster. We add a 'pems' parameter to the join API, so that joiners can use the same pem file as the cluster they are trying to join. Signed-off-by: Ben Anson <[email protected]>
1 parent 0cd00f6 commit a280f1d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cluster/cluster_interface.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ type node = {addr: address; id: nodeid} [@@deriving rpcty]
3636

3737
type all_members = node list [@@deriving rpcty]
3838

39+
type pems = {cn: string; blobs: string list} [@@deriving rpcty]
40+
41+
type pems_opt = pems option [@@deriving rpcty]
42+
3943
(** This type contains all of the information required to initialise the
4044
cluster. All optional params will have the recommended defaults if None. *)
4145
type init_config = {
4246
local_ip: address
4347
; token_timeout_ms: int64 option
4448
; token_coefficient_ms: int64 option
4549
; name: string option
50+
; pems: pems option
4651
}
4752
[@@deriving rpcty]
4853

@@ -57,6 +62,7 @@ type cluster_config = {
5762
; config_version: int64
5863
; cluster_token_timeout_ms: int64
5964
; cluster_token_coefficient_ms: int64
65+
; pems: pems option
6066
}
6167
[@@deriving rpcty]
6268

@@ -119,6 +125,11 @@ let debug_info_p =
119125
~description:["An uninterpreted string to associate with the operation."]
120126
debug_info
121127

128+
let pems_opt_p =
129+
Param.mk ~name:"pems"
130+
~description:["keys and certs cluster node should use"]
131+
pems_opt
132+
122133
type remove = bool [@@deriving rpcty]
123134

124135
module LocalAPI (R : RPC) = struct
@@ -198,6 +209,7 @@ module LocalAPI (R : RPC) = struct
198209
@-> token_p
199210
@-> new_p
200211
@-> existing_p
212+
@-> pems_opt_p
201213
@-> returning unit_p err
202214
)
203215

0 commit comments

Comments
 (0)