Skip to content

Commit d04519d

Browse files
committed
fix: update copyright year and add password placeholder handling in store update
1 parent 255579b commit d04519d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pkg/server/remote_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ func (s *server) GetStores(ctx context.Context, in *Empty) (reply *Stores, err e
11611161
storeStatus, sErr := s.VerifyStore(ctx, &SimpleQuery{Name: item.Name})
11621162
grpcStore.Ready = sErr == nil && storeStatus.Ready
11631163
grpcStore.ReadOnly = storeStatus.ReadOnly
1164-
grpcStore.Password = "******" // return a placeholder instead of the actual value for the security reason
1164+
grpcStore.Password = util.PasswordPlaceholder
11651165

11661166
reply.Data = append(reply.Data, grpcStore)
11671167
}

pkg/testing/store.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package testing
2626

2727
import (
2828
"fmt"
29+
"github.com/linuxsuren/api-testing/pkg/util"
2930
"os"
3031
"path"
3132
"strings"
@@ -186,6 +187,10 @@ func (s *storeFactory) UpdateStore(store Store) (err error) {
186187
for i := range storeConfig.Stores {
187188
item := storeConfig.Stores[i]
188189
if item.Name == store.Name {
190+
if store.Password == util.PasswordPlaceholder {
191+
// the password is not changed
192+
store.Password = storeConfig.Stores[i].Password
193+
}
189194
storeConfig.Stores[i] = store
190195
exist = true
191196
break

pkg/util/default.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2023 API Testing Authors.
2+
Copyright 2023-2025 API Testing Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -82,3 +82,5 @@ const (
8282
Plain = "text/plain"
8383
Authorization = "Authorization"
8484
)
85+
86+
const PasswordPlaceholder = "******"

0 commit comments

Comments
 (0)