Interface TokenRefresher
-
- All Known Implementing Classes:
OAuthTokensStorage
public interface TokenRefresher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuthTokengetToken(String vcsRootExtId, String tokenFullId, boolean checkProjectScope, boolean refreshIfExpired)Retrieve a token object from storage by its full id.OAuthTokengetToken(SProject project, String tokenFullId, boolean checkProjectScope, boolean refreshIfExpired)Retrieve a token object from storage by its full id.
-
-
-
Method Detail
-
getToken
@Nullable OAuthToken getToken(@Nullable SProject project, @NotNull String tokenFullId, boolean checkProjectScope, boolean refreshIfExpired)
Retrieve a token object from storage by its full id. If the token is expired, the method may attempt to refresh it, store and return a new token.- Parameters:
project- a project used as a context to locate a relevant connection and check project scopetokenFullId- a token full id in the form of oauth2:CONNECTION_ID:USER_ID:UUID_OF_TOKENcheckProjectScope- if true the method checks the project scope before returning the tockenrefreshIfExpired- if the token is expired, attempt to refresh it- Returns:
- access token object, null if such a token is not found in the storage or failed to get refreshed
-
getToken
@Nullable OAuthToken getToken(@NotNull String vcsRootExtId, @NotNull String tokenFullId, boolean checkProjectScope, boolean refreshIfExpired)
Retrieve a token object from storage by its full id. If the token is expired, the method may attempt to refresh it, store and return a new token.- Parameters:
vcsRootExtId- an external id of the relevant VCS roottokenFullId- a token full id in the form of oauth2:CONNECTION_ID:USER_ID:UUID_OF_TOKENcheckProjectScope- if true the method checks the project scope before returning the tockenrefreshIfExpired- if the token is expired, attempt to refresh it- Returns:
- access token object, null if such a token is not found in the storage or failed to get refreshed
-
-