Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG:加密配置的配置详情页面版本对比配置展示未解密 #11695

Closed
junechouiscoming opened this issue Jan 24, 2024 · 1 comment · Fixed by #11707
Closed

BUG:加密配置的配置详情页面版本对比配置展示未解密 #11695

junechouiscoming opened this issue Jan 24, 2024 · 1 comment · Fixed by #11707
Assignees
Labels
area/Config kind/bug Category issues or prs related to bug. plugin

Comments

@junechouiscoming
Copy link

2.2.0开始就有的bug,加密的配置在配置详情页面点击版本对比,右侧的上一版本配置未解密展示(接口/v1/cs/history/previous)
image

历史版本页面里面的配置比较可以正常解密展示(接口/v1/cs/history)

看代码是getPreviousConfigHistoryInfo方法未解密数据

    /**
     * Query the detailed configuration history information.
     */
    public ConfigHistoryInfo getConfigHistoryInfo(String dataId, String group, String namespaceId, Long nid)
            throws AccessException {
        ConfigHistoryInfo configHistoryInfo = historyConfigInfoPersistService.detailConfigHistory(nid);
        if (Objects.isNull(configHistoryInfo)) {
            return null;
        }
        // check if history config match the input
        checkHistoryInfoPermission(configHistoryInfo, dataId, group, namespaceId);
        
        String encryptedDataKey = configHistoryInfo.getEncryptedDataKey();
        Pair<String, String> pair = EncryptionHandler
                .decryptHandler(dataId, encryptedDataKey, configHistoryInfo.getContent());
        configHistoryInfo.setContent(pair.getSecond());
        
        return configHistoryInfo;
    }
    
    /**
     * Query previous config history information.
     */
    public ConfigHistoryInfo getPreviousConfigHistoryInfo(String dataId, String group, String namespaceId, Long id)
            throws AccessException {
        ConfigHistoryInfo configHistoryInfo = historyConfigInfoPersistService.detailPreviousConfigHistory(id);
        if (Objects.isNull(configHistoryInfo)) {
            return null;
        }
        // check if history config match the input
        checkHistoryInfoPermission(configHistoryInfo, dataId, group, namespaceId);
        return configHistoryInfo;
    }
@godhth
Copy link
Contributor

godhth commented Jan 25, 2024

@ i will solve it @

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Config kind/bug Category issues or prs related to bug. plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants