How to calculate the alias used for replacing the Full Name of a deleted user in Confluence

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

    

Please be aware that this material is provided for your information only and that you use it at your own risk.

Atlassian Support cannot guarantee to provide any support for the code outlined on this page as customisations are not covered under Atlassian Support Offerings.


要約

As described in Delete or Disable Users under section "How deleted users appear to other people", once a user account has been deleted their identity will be anonymised and their full names will be replaced with an alias. 

This document explains how that new alias is generated. 

ソリューション

When a user is anonymised, their usernames will be replaced by the user_key and the Full Name of the user will be replaced by an alias like "user-{vwxyz}". 


This {vwxyz
} value is derived from the user_key, calculating the SHA-256 digest in hexadecimal, and taking only the first 5 characters out of the result. 

The following code is a simple snippet of how this alias can be calculated for any of your users: 

package DeletedAlias;

import java.nio.charset.StandardCharsets;
import static org.apache.commons.codec.digest.DigestUtils.sha256Hex;

public class DeletedAlias {

	public static void main(String[] args) {
		
		String userKeyString = "<USER_KEY_OF_YOUR_USER>";         
                String userKeyHash = sha256Hex(userKeyString.getBytes(StandardCharsets.UTF_8));
                System.out.println("user-" + userKeyHash.substring(0, 5));

	}

}

In order to get the user_key of one specific user, you can query the USER_MAPPING table in your Confluence database. 





最終更新日 2023 年 6 月 27 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.