Class MultiTeamsAuthorization
java.lang.Object
com.slack.api.bolt.middleware.builtin.MultiTeamsAuthorization
- All Implemented Interfaces:
Middleware
public class MultiTeamsAuthorization extends java.lang.Object implements Middleware
Verifies if valid installations exist for requests.
-
Constructor Summary
Constructors Constructor Description MultiTeamsAuthorization(AppConfig config, InstallationService installationService)
-
Method Summary
Modifier and Type Method Description Response
apply(Request req, Response resp, MiddlewareChain chain)
protected Response
buildError(int statusCode, AuthTestResponse authTestResponse, java.io.IOException ioException, SlackApiException slackException)
protected AuthTestResponse
callAuthTest(java.lang.String token, AppConfig config, MethodsClient client)
protected void
finalize()
protected Response
handleAuthTestError(java.lang.String errorCode, Bot foundBot, Installer foundInstaller, AuthTestResponse authTestResponse)
boolean
isAlwaysRequestUserTokenNeeded()
void
setAlwaysRequestUserTokenNeeded(boolean alwaysRequestUserTokenNeeded)
-
Constructor Details
-
Method Details
-
isAlwaysRequestUserTokenNeeded
public boolean isAlwaysRequestUserTokenNeeded() -
setAlwaysRequestUserTokenNeeded
public void setAlwaysRequestUserTokenNeeded(boolean alwaysRequestUserTokenNeeded) -
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
apply
public Response apply(Request req, Response resp, MiddlewareChain chain) throws java.lang.Exception- Specified by:
apply
in interfaceMiddleware
- Throws:
java.lang.Exception
-
callAuthTest
protected AuthTestResponse callAuthTest(java.lang.String token, AppConfig config, MethodsClient client) throws java.io.IOException, SlackApiException- Throws:
java.io.IOException
SlackApiException
-
handleAuthTestError
protected Response handleAuthTestError(java.lang.String errorCode, Bot foundBot, Installer foundInstaller, AuthTestResponse authTestResponse) throws java.lang.Exception- Throws:
java.lang.Exception
-
buildError
protected Response buildError(int statusCode, AuthTestResponse authTestResponse, java.io.IOException ioException, SlackApiException slackException)
-