public class AccountManager
extends java.lang.Object
Constructor and Description |
---|
AccountManager(Sequences sequences,
org.eclipse.jgit.lib.Config cfg,
Accounts accounts,
com.google.inject.Provider<AccountsUpdate> accountsUpdateProvider,
AccountCache byIdCache,
Realm accountMapper,
IdentifiedUser.GenericFactory userFactory,
SshKeyCache sshKeyCache,
ProjectCache projectCache,
ExternalIds externalIds,
GroupsUpdate.Factory groupsUpdateFactory,
SetInactiveFlag setInactiveFlag) |
Modifier and Type | Method and Description |
---|---|
AuthResult |
authenticate(AuthRequest who)
Authenticate the user, potentially creating a new account if they are new.
|
AuthResult |
link(Account.Id to,
AuthRequest who)
Link another authentication identity to an existing account.
|
java.util.Optional<Account.Id> |
lookup(java.lang.String externalId) |
void |
unlink(Account.Id from,
java.util.Collection<ExternalId.Key> extIdKeys)
Unlink an external identities from an existing account.
|
void |
unlink(Account.Id from,
ExternalId.Key extIdKey)
Unlink an external identity from an existing account.
|
AuthResult |
updateLink(Account.Id to,
AuthRequest who)
Update the link to another unique authentication identity to an existing account.
|
@Inject public AccountManager(Sequences sequences, org.eclipse.jgit.lib.Config cfg, Accounts accounts, com.google.inject.Provider<AccountsUpdate> accountsUpdateProvider, AccountCache byIdCache, Realm accountMapper, IdentifiedUser.GenericFactory userFactory, SshKeyCache sshKeyCache, ProjectCache projectCache, ExternalIds externalIds, GroupsUpdate.Factory groupsUpdateFactory, SetInactiveFlag setInactiveFlag)
public java.util.Optional<Account.Id> lookup(java.lang.String externalId) throws AccountException
AccountException
public AuthResult authenticate(AuthRequest who) throws AccountException, java.io.IOException
who
- identity of the user, with any details we received about them.AccountException
- the account does not exist, and cannot be created, or exists, but
cannot be located, is unable to be activated or deactivated, or is inactive, or cannot be
added to the admin group (only for the first account).java.io.IOException
public AuthResult link(Account.Id to, AuthRequest who) throws AccountException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
to
- account to link the identity onto.who
- the additional identity.AccountException
- the identity belongs to a different account, or it cannot be linked at
this time.java.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
public AuthResult updateLink(Account.Id to, AuthRequest who) throws AccountException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
Existing external identities with the same scheme will be removed and replaced with the new one.
to
- account to link the identity onto.who
- the additional identity.AccountException
- the identity belongs to a different account, or it cannot be linked at
this time.java.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
public void unlink(Account.Id from, ExternalId.Key extIdKey) throws AccountException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
from
- account to unlink the external identity fromextIdKey
- the key of the external ID that should be deletedAccountException
- the identity belongs to a different account, or the identity was not
foundjava.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
public void unlink(Account.Id from, java.util.Collection<ExternalId.Key> extIdKeys) throws AccountException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
from
- account to unlink the external identity fromextIdKeys
- the keys of the external IDs that should be deletedAccountException
- any of the identity belongs to a different account, or any of the
identity was not foundjava.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException