This fixes the exception of
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutParameter operation: Invalid request: tags and overwrite can't be used together. To create a parameter with tags, please remove overwrite flag. To update tags for an existing parameter, please use AddTagsToResource or RemoveTagsFromResource.
This will make the IAM user and API keys durable across API
stack rebuilds.
This also grants the IAM user rights to invoke all deployments
of the API and all SQS queues used by the API
Deal with exceptions differently depending on if the function was called
by API Gateway or through direct invocation.
Pass SlackExceptions through to the invoker of the function.
* Add functions to utils
* store_oauth_token : Store an OAuth 2 access token in SSM parameter store
* get_access_token : Fetch the OAuth 2 access token for a given client_id from cache or SSM
parameter store
* emit_to_mozdef : Send a message with the user's response to SQS for pickup by MozDef
* call_slack : POST to a slack URL and return the result
* provision_token : Given an OAuth 2 code, obtain a Slack access token and store it
* redirect_to_slack_authorize : Build a Slack OAuth 2 authorization URL and redirect the user to it
* Fill out lambda_handler in app to cover all URL paths and direct invocations
* Add functions to app
* API calls
* process_api_call : Process an API Gateway call depending on the URL path called
* `/authorize` : utils.redirect_to_slack_authorize
* `/redirect_uri` : utils.provision_token
* `/slack/interactive-endpoint` : handle_message_interaction : Process a user's interaction with a Slack message
* send_slack_message_response : Respond to a user's selection by updating the Slack message with a reply
* Direct invocations
* send_message_to_slack : Send a message to a user via IM or Slack App conversation
* get_user_from_email : Fetch a slack user dictionary for an email address
* compose_message : Create a Slack message object
* create_slack_channel : Create an IM channel with a user
* post_message : Post a message to a slack channel
* Update README with configuration details
* Add details on discovering the SQS URL to the README
* Add additional test invocations to the Makefile
* Add SQS URL discovery to the Makefile
* Add requests to the requirements.txt
* Update CloudFormation template to
* accept Slack client ID and secret
* Grant Lambda function rights to
* read and write to SSM parameter store
* decrypt parameter store secrets
* send messages to the SQS queue
* Create the SQS queue
* Grant the MozDef user rights to read from the SQS queue
* Add new settings to config.py