Package com.google.gerrit.server.account
Interface Realm
-
- All Known Implementing Classes:
AbstractRealm
,DefaultRealm
,FakeRealm
public interface Realm
Interface between Gerrit and an account system.This interface provides the glue layer between the Gerrit and external account/authentication systems (eg. LDAP, OpenID).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
accountBelongsToRealm(Collection<ExternalId> externalIds)
Returns true if the account is backed by the realm, false otherwise.boolean
allowsEdit(AccountFieldName field)
Can the end-user modify this field of their own account?AuthRequest
authenticate(AuthRequest who)
Set<AccountFieldName>
getEditableFields()
Returns the account fields that the end-user can modify.Set<String>
getEmailAddresses(IdentifiedUser who)
Returns all known email addresses for the identified user.boolean
hasEmailAddress(IdentifiedUser who, String email)
Returns true if the user has the given email address.default boolean
isActive(String username)
Returns true if the account is active.Account.Id
lookup(String accountName)
Locate an account whose local username is the given account name.void
onCreateAccount(AuthRequest who, Account account)
-
-
-
Method Detail
-
allowsEdit
boolean allowsEdit(AccountFieldName field)
Can the end-user modify this field of their own account?
-
getEditableFields
Set<AccountFieldName> getEditableFields()
Returns the account fields that the end-user can modify.
-
authenticate
AuthRequest authenticate(AuthRequest who) throws AccountException
- Throws:
AccountException
-
onCreateAccount
void onCreateAccount(AuthRequest who, Account account)
-
hasEmailAddress
boolean hasEmailAddress(IdentifiedUser who, String email)
Returns true if the user has the given email address.
-
getEmailAddresses
Set<String> getEmailAddresses(IdentifiedUser who)
Returns all known email addresses for the identified user.
-
lookup
Account.Id lookup(String accountName) throws IOException
Locate an account whose local username is the given account name.Generally this only works for local realms, such as one backed by an LDAP directory, or where there is an
EmailExpander
configured that knows how to convert the accountName into an email address, and then locate the user by that email address.- Throws:
IOException
-
isActive
default boolean isActive(String username) throws LoginException, NamingException, AccountException, IOException
Returns true if the account is active.
-
accountBelongsToRealm
default boolean accountBelongsToRealm(Collection<ExternalId> externalIds)
Returns true if the account is backed by the realm, false otherwise.
-
-