Class AmazonS3OAuthStateService
- java.lang.Object
-
- com.slack.api.bolt.service.builtin.AmazonS3OAuthStateService
-
- All Implemented Interfaces:
OAuthStateService
,Service
public class AmazonS3OAuthStateService extends Object implements OAuthStateService
OAuthStateService implementation using Amazon S3.- See Also:
- Amazon S3
-
-
Field Summary
-
Fields inherited from interface com.slack.api.bolt.service.OAuthStateService
DEFAULT_EXPIRATION_IN_SECONDS
-
-
Constructor Summary
Constructors Constructor Description AmazonS3OAuthStateService(String bucketName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNewStateToDatastore(String state)
Adds a newly generated state value to the server-side datastore.protected com.amazonaws.services.s3.AmazonS3
createS3Client()
void
deleteStateFromDatastore(String state)
Deletes a given state value from the server-side datastore.protected com.amazonaws.auth.AWSCredentials
getCredentials()
Initializer
initializer()
Returns the initializer for this service.boolean
isAvailableInDatabase(String state)
Verifies the state value is available in the datastore and returns true if it's valid.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.slack.api.bolt.service.OAuthStateService
consume, extractStateFromQueryString, extractStateFromSession, generateNewStateValue, generateSessionCookieValue, getExpirationInSeconds, getSessionCookieName, issueNewState, isValid
-
-
-
-
Constructor Detail
-
AmazonS3OAuthStateService
public AmazonS3OAuthStateService(String bucketName)
-
-
Method Detail
-
initializer
public Initializer initializer()
Description copied from interface:Service
Returns the initializer for this service. If the service has time-consuming initialization steps, putting those into this function would be a good way to avoid timeout errors for the first incoming request (in other words, to avoid cold-start problems).- Specified by:
initializer
in interfaceService
-
addNewStateToDatastore
public void addNewStateToDatastore(String state) throws Exception
Description copied from interface:OAuthStateService
Adds a newly generated state value to the server-side datastore.- Specified by:
addNewStateToDatastore
in interfaceOAuthStateService
- Throws:
Exception
-
isAvailableInDatabase
public boolean isAvailableInDatabase(String state)
Description copied from interface:OAuthStateService
Verifies the state value is available in the datastore and returns true if it's valid.- Specified by:
isAvailableInDatabase
in interfaceOAuthStateService
-
deleteStateFromDatastore
public void deleteStateFromDatastore(String state) throws Exception
Description copied from interface:OAuthStateService
Deletes a given state value from the server-side datastore.- Specified by:
deleteStateFromDatastore
in interfaceOAuthStateService
- Throws:
Exception
-
getCredentials
protected com.amazonaws.auth.AWSCredentials getCredentials()
-
createS3Client
protected com.amazonaws.services.s3.AmazonS3 createS3Client()
-
-