File tree 3 files changed +10
-6
lines changed
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,9 @@ func prettyPrint(data []byte) string {
211
211
// redactPasswords: Redacts password values from a JSON message.
212
212
func redactPasswords (data string ) string {
213
213
m1 := regexp .MustCompile (`\"password\"\s*:\s*\"(?:[^"\\]|\\.)*\"` )
214
- return m1 .ReplaceAllString (data , "\" password\" : \" REDACTED\" " )
214
+ output := m1 .ReplaceAllString (data , "\" password\" : \" REDACTED\" " )
215
+ m2 := regexp .MustCompile (`\"global_password\"\s*:\s*\"(?:[^"\\]|\\.)*\"` )
216
+ return m2 .ReplaceAllString (output , "\" global_password\" : \" REDACTED\" " )
215
217
}
216
218
217
219
func escapePath (path string ) string {
Original file line number Diff line number Diff line change @@ -252,8 +252,8 @@ func TestCredentialTripper_RedactPasswordFromNestedBody(t *testing.T) {
252
252
ProtoMajor : 1 ,
253
253
ProtoMinor : 1 ,
254
254
Header : map [string ][]string {},
255
- Body : ioutil .NopCloser (bytes .NewBufferString (`{"security": {"password":"pass"}}` )),
256
- ContentLength : 33 ,
255
+ Body : ioutil .NopCloser (bytes .NewBufferString (`{"security": {"password":"pass", "global_password":"globalpass" }}` )),
256
+ ContentLength : 65 ,
257
257
Host : "example.org" ,
258
258
}
259
259
expected := & http.Response {
@@ -262,7 +262,7 @@ func TestCredentialTripper_RedactPasswordFromNestedBody(t *testing.T) {
262
262
ProtoMajor : 1 ,
263
263
ProtoMinor : 1 ,
264
264
Header : map [string ][]string {},
265
- Body : ioutil .NopCloser (bytes .NewBufferString (`{"security": {"password":"REDACTED"}}` )),
265
+ Body : ioutil .NopCloser (bytes .NewBufferString (`{"security": {"password":"REDACTED", "global_password":"REDACTED" }}` )),
266
266
}
267
267
268
268
mockTripper .On ("RoundTrip" , request ).Return (expected , nil )
@@ -285,13 +285,14 @@ func TestCredentialTripper_RedactPasswordFromNestedBody(t *testing.T) {
285
285
POST /foo/bar HTTP/1.1
286
286
Host: example.org
287
287
User-Agent: test-user-agent
288
- Content-Length: 33
288
+ Content-Length: 65
289
289
Accept: application/json
290
290
Accept-Encoding: gzip
291
291
292
292
{
293
293
"security": {
294
- "password": "REDACTED"
294
+ "password": "REDACTED",
295
+ "global_password": "REDACTED"
295
296
}
296
297
}` , mockLogger .log [0 ])
297
298
}
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ type CreateActiveActiveDatabase struct {
63
63
MemoryLimitInGB * float64 `json:"memoryLimitInGb,omitempty"`
64
64
SupportOSSClusterAPI * bool `json:"supportOSSClusterApi,omitempty"`
65
65
UseExternalEndpointForOSSClusterAPI * bool `json:"useExternalEndpointForOSSClusterApi,omitempty"`
66
+ DataEvictionPolicy * string `json:"dataEvictionPolicy,omitempty"`
66
67
GlobalDataPersistence * string `json:"dataPersistence,omitempty"`
67
68
GlobalSourceIP []* string `json:"sourceIp,omitempty"`
68
69
GlobalPassword * string `json:"password,omitempty"`
You can’t perform that action at this time.
0 commit comments