Skip to content

Commit

Permalink
fix:configuration of enabling encryption did not return the correct f…
Browse files Browse the repository at this point in the history
…ields. (#1254)
  • Loading branch information
chuntaojun authored Sep 17, 2023
1 parent 01f9cf8 commit 3378169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 3 additions & 0 deletions config/config_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func (chain *CryptoConfigFileChain) BeforeCreateFile(ctx context.Context,
// AfterCreateFile
func (chain *CryptoConfigFileChain) AfterGetFile(ctx context.Context,
file *model.ConfigFile) (*model.ConfigFile, error) {
if file.IsEncrypted() {
file.Encrypt = true
}

encryptAlgo := file.GetEncryptAlgo()
dataKey := file.GetEncryptDataKey()
Expand Down
8 changes: 0 additions & 8 deletions config/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,6 @@ func (s *Server) SearchConfigFile(ctx context.Context, filter map[string]string)
searchFilters[k] = v
}
}

if err := s.fileCache.Update(); err != nil {
log.Error("[Config][File] force update release cache when search config files.",
utils.RequestID(ctx), zap.Error(err))
out := api.NewConfigBatchQueryResponse(commonstore.StoreCode2APICode(err))
return out
}

count, files, err := s.storage.QueryConfigFiles(searchFilters, offset, limit)
if err != nil {
log.Error("[Config][File] search config files.", utils.RequestID(ctx), zap.Error(err))
Expand Down

0 comments on commit 3378169

Please sign in to comment.