Document PutUsername

Change-Id: I56eb21dfe4a56f8b8e7b36ce8e1bb039a6686475
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2019-12-13 15:07:46 +01:00
parent 061bf2bc19
commit e6e1421a07

View File

@@ -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.
*
* <p>This REST endpoint handles {@code PUT /accounts/<account-identifier>/username} requests.
*
* <p>Whether a username can be set depends on whether the used {@link Realm} supports this.
*
* <p>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<AccountResource, UsernameInput> {
private final Provider<CurrentUser> self;