Package com.google.gerrit.server.mail
Interface EmailTokenVerifier
-
- All Known Implementing Classes:
SignedTokenEmailTokenVerifier
public interface EmailTokenVerifier
Verifies the token sent byRegisterNewEmailSender
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EmailTokenVerifier.InvalidTokenException
Exception thrown when a token does not parse correctly.static class
EmailTokenVerifier.ParsedToken
Pair returned from decode to provide the data used during encode.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EmailTokenVerifier.ParsedToken
decode(String tokenString)
Decode a token previously created.String
encode(Account.Id accountId, String emailAddress)
Construct a token to verify an email address for a user.
-
-
-
Method Detail
-
encode
String encode(Account.Id accountId, String emailAddress)
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.
-
-