fix: update copyright year and add password placeholder handling in store update
This commit is contained in:
parent
255579bd23
commit
d04519d6b6
|
@ -1161,7 +1161,7 @@ func (s *server) GetStores(ctx context.Context, in *Empty) (reply *Stores, err e
|
||||||
storeStatus, sErr := s.VerifyStore(ctx, &SimpleQuery{Name: item.Name})
|
storeStatus, sErr := s.VerifyStore(ctx, &SimpleQuery{Name: item.Name})
|
||||||
grpcStore.Ready = sErr == nil && storeStatus.Ready
|
grpcStore.Ready = sErr == nil && storeStatus.Ready
|
||||||
grpcStore.ReadOnly = storeStatus.ReadOnly
|
grpcStore.ReadOnly = storeStatus.ReadOnly
|
||||||
grpcStore.Password = "******" // return a placeholder instead of the actual value for the security reason
|
grpcStore.Password = util.PasswordPlaceholder
|
||||||
|
|
||||||
reply.Data = append(reply.Data, grpcStore)
|
reply.Data = append(reply.Data, grpcStore)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/linuxsuren/api-testing/pkg/util"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -186,6 +187,10 @@ func (s *storeFactory) UpdateStore(store Store) (err error) {
|
||||||
for i := range storeConfig.Stores {
|
for i := range storeConfig.Stores {
|
||||||
item := storeConfig.Stores[i]
|
item := storeConfig.Stores[i]
|
||||||
if item.Name == store.Name {
|
if item.Name == store.Name {
|
||||||
|
if store.Password == util.PasswordPlaceholder {
|
||||||
|
// the password is not changed
|
||||||
|
store.Password = storeConfig.Stores[i].Password
|
||||||
|
}
|
||||||
storeConfig.Stores[i] = store
|
storeConfig.Stores[i] = store
|
||||||
exist = true
|
exist = true
|
||||||
break
|
break
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2023 API Testing Authors.
|
Copyright 2023-2025 API Testing Authors.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -82,3 +82,5 @@ const (
|
||||||
Plain = "text/plain"
|
Plain = "text/plain"
|
||||||
Authorization = "Authorization"
|
Authorization = "Authorization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const PasswordPlaceholder = "******"
|
||||||
|
|
Loading…
Reference in New Issue