@@ -50,16 +50,10 @@ func Define_bbr_not_colocated_ops() []OpDefinition {
50
50
51
51
func Define_bbr_ssl_verify_full () []OpDefinition {
52
52
var ops []OpDefinition
53
- var value interface {}
54
- var path string
55
53
56
54
ops = Define_bbr_not_colocated_ops ()
57
55
ops = append (ops , Define_ssl_ops ()... )
58
56
59
- path = "/instance_groups/name=backup/jobs/name=bbr-postgres-db/properties/postgres?/ca"
60
- value = "((postgres_cert.ca))"
61
- AddOpDefinition (& ops , "replace" , path , value )
62
-
63
57
return ops
64
58
}
65
59
@@ -77,6 +71,51 @@ func Define_bbr_ssl_verify_ca() []OpDefinition {
77
71
return ops
78
72
}
79
73
74
+ func Define_bbr_client_certs () []OpDefinition {
75
+ var ops []OpDefinition
76
+ var value interface {}
77
+ var path string
78
+
79
+ bbruser := "bbruser"
80
+
81
+ ops = Define_bbr_not_colocated_ops ()
82
+ ops = append (ops , Define_mutual_ssl_ops ()... )
83
+
84
+ path = "/instance_groups/name=backup/jobs/name=bbr-postgres-db/properties/postgres?/client_certificate"
85
+ value = "((bbr_user_certs.certificate))"
86
+ AddOpDefinition (& ops , "replace" , path , value )
87
+
88
+ path = "/instance_groups/name=backup/jobs/name=bbr-postgres-db/properties/postgres?/client_certificate_key"
89
+ value = "((bbr_user_certs.private_key))"
90
+ AddOpDefinition (& ops , "replace" , path , value )
91
+
92
+ path = "/variables?/name=bbr_user_certs?"
93
+ value = map [interface {}]interface {}{
94
+ "name" : "bbr_user_certs" ,
95
+ "type" : "certificate" ,
96
+ "options" : map [interface {}]interface {}{
97
+ "ca" : "postgres_ca" ,
98
+ "common_name" : bbruser ,
99
+ "alternative_names" : []interface {}{},
100
+ "extended_key_usage" : []interface {}{"server_auth" , "client_auth" },
101
+ },
102
+ }
103
+ AddOpDefinition (& ops , "replace" , path , value )
104
+
105
+ path = "/instance_groups/name=postgres/jobs/name=postgres/properties/databases/roles?/name=bbruser?"
106
+ value = map [interface {}]interface {}{
107
+ "name" : bbruser ,
108
+ "permissions" : []interface {}{"SUPERUSER" },
109
+ }
110
+ AddOpDefinition (& ops , "replace" , path , value )
111
+
112
+ path = "/instance_groups/name=backup/jobs/name=bbr-postgres-db/properties/postgres?/dbuser"
113
+ value = bbruser
114
+ AddOpDefinition (& ops , "replace" , path , value )
115
+
116
+ return ops
117
+ }
118
+
80
119
func Define_upgrade_no_copy_ops () []OpDefinition {
81
120
var ops []OpDefinition
82
121
var value interface {}
0 commit comments