Document PutUsername
Change-Id: I56eb21dfe4a56f8b8e7b36ce8e1bb039a6686475 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -46,6 +46,17 @@ import java.io.IOException;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
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
|
@Singleton
|
||||||
public class PutUsername implements RestModifyView<AccountResource, UsernameInput> {
|
public class PutUsername implements RestModifyView<AccountResource, UsernameInput> {
|
||||||
private final Provider<CurrentUser> self;
|
private final Provider<CurrentUser> self;
|
||||||
|
|||||||
Reference in New Issue
Block a user