Loading mail/common/src/main/java/com/fsck/k9/mail/oauth/OAuth2TokenProvider.kt +13 −14 Original line number Original line Diff line number Diff line package com.fsck.k9.mail.oauth; package com.fsck.k9.mail.oauth import com.fsck.k9.mail.AuthenticationFailedException import com.fsck.k9.mail.AuthenticationFailedException; interface OAuth2TokenProvider { companion object { public interface OAuth2TokenProvider { /** /** * A default timeout value to use when fetching tokens. * A default timeout value to use when fetching tokens. */ */ int OAUTH2_TIMEOUT = 30000; const val OAUTH2_TIMEOUT: Int = 30000 } /** /** * Fetch a token. No guarantees are provided for validity. * Fetch a token. No guarantees are provided for validity. */ */ String getToken(long timeoutMillis) throws AuthenticationFailedException; @Throws(AuthenticationFailedException::class) fun getToken(timeoutMillis: Long): String /** /** * Invalidate the token for this username. * Invalidate the token for this username. * * * <p> * Note that the token should always be invalidated on credential failure. However invalidating a token every * Note that the token should always be invalidated on credential failure. However invalidating a token every * single time is not recommended. * single time is not recommended. * <p> * * Invalidating a token and then failure with a new token should be treated as a permanent failure. * Invalidating a token and then failure with a new token should be treated as a permanent failure. */ */ void invalidateToken(); fun invalidateToken() } } Loading
mail/common/src/main/java/com/fsck/k9/mail/oauth/OAuth2TokenProvider.kt +13 −14 Original line number Original line Diff line number Diff line package com.fsck.k9.mail.oauth; package com.fsck.k9.mail.oauth import com.fsck.k9.mail.AuthenticationFailedException import com.fsck.k9.mail.AuthenticationFailedException; interface OAuth2TokenProvider { companion object { public interface OAuth2TokenProvider { /** /** * A default timeout value to use when fetching tokens. * A default timeout value to use when fetching tokens. */ */ int OAUTH2_TIMEOUT = 30000; const val OAUTH2_TIMEOUT: Int = 30000 } /** /** * Fetch a token. No guarantees are provided for validity. * Fetch a token. No guarantees are provided for validity. */ */ String getToken(long timeoutMillis) throws AuthenticationFailedException; @Throws(AuthenticationFailedException::class) fun getToken(timeoutMillis: Long): String /** /** * Invalidate the token for this username. * Invalidate the token for this username. * * * <p> * Note that the token should always be invalidated on credential failure. However invalidating a token every * Note that the token should always be invalidated on credential failure. However invalidating a token every * single time is not recommended. * single time is not recommended. * <p> * * Invalidating a token and then failure with a new token should be treated as a permanent failure. * Invalidating a token and then failure with a new token should be treated as a permanent failure. */ */ void invalidateToken(); fun invalidateToken() } }