diff --git a/java/com/google/gerrit/server/restapi/account/PutUsername.java b/java/com/google/gerrit/server/restapi/account/PutUsername.java index 3c73d88135..dabfaa5503 100644 --- a/java/com/google/gerrit/server/restapi/account/PutUsername.java +++ b/java/com/google/gerrit/server/restapi/account/PutUsername.java @@ -46,6 +46,17 @@ import java.io.IOException; import java.util.Optional; import org.eclipse.jgit.errors.ConfigInvalidException; +/** + * REST endpoint to set the username of an account. + * + *
This REST endpoint handles {@code PUT /accounts/ Whether a username can be set depends on whether the used {@link Realm} supports this.
+ *
+ * Once set a username cannot be changed or deleted. Changing usernames is disallowed because
+ * they can be used in ref names that represent user-specific sandbox branches which can exist in
+ * any repository and we have no way to find and rename those refs.
+ */
@Singleton
public class PutUsername implements RestModifyView