Class ExternalId
java.lang.Object
com.google.gerrit.server.account.externalids.ExternalId
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Scheme for external auth used during authentication, e.g.static final String
Scheme used to label accounts created, when using the LDAP-based authentication typesAuthType.LDAP
,AuthType.CLIENT_SSL_CERT_LDAP
,AuthType.HTTP_LDAP
, andAuthType.LDAP_BIND
.static final String
Scheme for Google OAuth external IDs.static final String
Scheme used for GPG public keys.static final String
Scheme for http resources.static final String
Scheme for https resources.static final String
Scheme for imported accounts from other servers with different GerritServerIdstatic final String
Scheme used to represent only an email address.static final String
Scheme for the username used to authenticate an account, e.g.static final String
Scheme used for randomly created identities constructed by a UUID.static final String
Scheme for xri resources. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Account.Id
abstract org.eclipse.jgit.lib.ObjectId
blobId()
ID of the note blob in the external IDs branch that stores this external ID.void
static ExternalId
create
(ExternalId.Key key, Account.Id accountId, String email, String hashedPassword, org.eclipse.jgit.lib.ObjectId blobId) abstract String
email()
final boolean
For checking if two external IDs are equals the blobId is excluded and external IDs that have different blob IDs but identical other fields are considered equal.getEmails
(Collection<ExternalId> extIds) Returns all IDs of the provided external IDs that have theSCHEME_MAILTO
scheme as a distinct stream.getUserName
(Collection<ExternalId> extIds) Returns the ID of the first external ID from the provided external IDs that has theSCHEME_USERNAME
scheme.int
hashCode()
abstract boolean
boolean
static boolean
isValidUsername
(String username) abstract ExternalId.Key
key()
abstract String
password()
toString()
Exports this external ID as Git config file text.void
writeToConfig
(org.eclipse.jgit.lib.Config c)
-
Field Details
-
EXTERNAL_ID_SECTION
- See Also:
-
ACCOUNT_ID_KEY
- See Also:
-
EMAIL_KEY
- See Also:
-
PASSWORD_KEY
- See Also:
-
SCHEME_GERRIT
Scheme used to label accounts created, when using the LDAP-based authentication typesAuthType.LDAP
,AuthType.CLIENT_SSL_CERT_LDAP
,AuthType.HTTP_LDAP
, andAuthType.LDAP_BIND
. The external ID stores the username. Accounts with such an external ID will be authenticated against the configured LDAP identity provider.The name
gerrit:
was a very poor choice.Scheme names must not contain colons (':').
Will be handled case insensitive, if auth.userNameCaseInsensitive = true.
- See Also:
-
SCHEME_UUID
Scheme used for randomly created identities constructed by a UUID.- See Also:
-
SCHEME_MAILTO
Scheme used to represent only an email address.- See Also:
-
SCHEME_USERNAME
Scheme for the username used to authenticate an account, e.g. over SSH.Will be handled case insensitive, if auth.userNameCaseInsensitive = true.
- See Also:
-
SCHEME_GPGKEY
Scheme used for GPG public keys.- See Also:
-
SCHEME_IMPORTED
Scheme for imported accounts from other servers with different GerritServerId- See Also:
-
SCHEME_EXTERNAL
Scheme for external auth used during authentication, e.g. OAuth Token- See Also:
-
SCHEME_HTTP
Scheme for http resources. OpenID in particular makes use of these external IDs.- See Also:
-
SCHEME_HTTPS
Scheme for https resources. OpenID in particular makes use of these external IDs.- See Also:
-
SCHEME_XRI
Scheme for xri resources. OpenID in particular makes use of these external IDs.- See Also:
-
SCHEME_GOOGLE_OAUTH
Scheme for Google OAuth external IDs.- See Also:
-
-
Constructor Details
-
ExternalId
public ExternalId()
-
-
Method Details
-
isValidUsername
-
getUserName
Returns the ID of the first external ID from the provided external IDs that has theSCHEME_USERNAME
scheme.- Parameters:
extIds
- external IDs- Returns:
- the ID of the first external ID from the provided external IDs that has the
SCHEME_USERNAME
scheme
-
getEmails
Returns all IDs of the provided external IDs that have theSCHEME_MAILTO
scheme as a distinct stream.- Parameters:
extIds
- external IDs- Returns:
- distinct stream of all IDs of the provided external IDs that have the
SCHEME_MAILTO
scheme
-
create
public static ExternalId create(ExternalId.Key key, Account.Id accountId, String email, String hashedPassword, org.eclipse.jgit.lib.ObjectId blobId) -
key
-
accountId
-
isCaseInsensitive
public abstract boolean isCaseInsensitive() -
email
-
password
-
blobId
public abstract org.eclipse.jgit.lib.ObjectId blobId()ID of the note blob in the external IDs branch that stores this external ID.null
if the external ID was created in code and is not yet stored in Git. -
checkThatBlobIdIsSet
public void checkThatBlobIdIsSet() -
isScheme
-
equals
For checking if two external IDs are equals the blobId is excluded and external IDs that have different blob IDs but identical other fields are considered equal. This way an external ID that was loaded from Git can be equal with an external ID that was created from code. -
hashCode
@Memoized public int hashCode() -
toString
Exports this external ID as Git config file text.The Git config has exactly one externalId subsection with an accountId and optionally email and password:
[externalId "username:jdoe"] accountId = 1003407 email = [email protected] password = bcrypt:4:LCbmSBDivK/hhGVQMfkDpA==:XcWn0pKYSVU/UJgOvhidkEtmqCp6oKB7
-
writeToConfig
public void writeToConfig(org.eclipse.jgit.lib.Config c)
-