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
Modifier and TypeMethodDescriptiondefault 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?authenticate
(AuthRequest who) Returns the account fields that the end-user can modify.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
Returns true if the account is active.Locate an account whose local username is the given account name.void
onCreateAccount
(AuthRequest who, Account account)
-
Method Details
-
allowsEdit
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
- Throws:
AccountException
-
onCreateAccount
-
hasEmailAddress
Returns true if the user has the given email address. -
getEmailAddresses
Returns all known email addresses for the identified user. -
lookup
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.- Throws:
LoginException
- thrown if login is required and failsNamingException
- may be thrown if the name is invalidAccountException
- may be thrown in case the username is ambiguousIOException
- thrown in case of IO errors
-
accountBelongsToRealm
Returns true if the account is backed by the realm, false otherwise.
-