Package com.google.gerrit.server.mail
Interface EmailTokenVerifier
- All Known Implementing Classes:
SignedTokenEmailTokenVerifier
public interface EmailTokenVerifier
Verifies the token used by new email address verification process.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Exception thrown when a token does not parse correctly.static class
Pair returned from decode to provide the data used during encode. -
Method Summary
Modifier and TypeMethodDescriptionDecode a token previously created.encode
(Account.Id accountId, String emailAddress) Construct a token to verify an email address for a user.
-
Method Details
-
encode
Construct a token to verify an email address for a user.- Parameters:
accountId
- the caller that wants to add an email to their account.emailAddress
- the address to add.- Returns:
- an unforgeable string to email to
emailAddress
. Presenting the string provides proof the user has the ability to read messages sent to that address. Must not be null.
-
decode
EmailTokenVerifier.ParsedToken decode(String tokenString) throws EmailTokenVerifier.InvalidTokenException Decode a token previously created.- Parameters:
tokenString
- the string created by encode. Never null.- Returns:
- a pair of account id and email address.
- Throws:
EmailTokenVerifier.InvalidTokenException
- the token is invalid, expired, malformed, etc.
-