public class SignedTokenEmailTokenVerifier extends Object implements EmailTokenVerifier
RegisterNewEmailSender
.Modifier and Type | Class and Description |
---|---|
static class |
SignedTokenEmailTokenVerifier.Module |
EmailTokenVerifier.InvalidTokenException, EmailTokenVerifier.ParsedToken
Modifier and Type | Method and Description |
---|---|
EmailTokenVerifier.ParsedToken |
decode(String tokenString)
Decode a token previously created.
|
String |
encode(com.google.gerrit.reviewdb.client.Account.Id accountId,
String emailAddress)
Construct a token to verify an email address for a user.
|
public String encode(com.google.gerrit.reviewdb.client.Account.Id accountId, String emailAddress)
EmailTokenVerifier
encode
in interface EmailTokenVerifier
accountId
- the caller that wants to add an email to their account.emailAddress
- the address to add.emailAddress
. Presenting
the string provides proof the user has the ability to read messages
sent to that address. Must not be null.public EmailTokenVerifier.ParsedToken decode(String tokenString) throws EmailTokenVerifier.InvalidTokenException
EmailTokenVerifier
decode
in interface EmailTokenVerifier
tokenString
- the string created by encode. Never null.EmailTokenVerifier.InvalidTokenException
- the token is invalid, expired, malformed, etc.