Skip to content

Instantly share code, notes, and snippets.

View jamiemhall's full-sized avatar

Jamie Hall jamiemhall

  • Oxfordshire, UK
View GitHub Profile
@jamiemhall
jamiemhall / slack_slash_cmd_verification_with_flask.py
Created November 21, 2018 15:46
A Flask template to handle requests from Slack slash commands. Includes 1) verification using signed secrets, rather than the simpler verification token, 2) timestamp check to prevent replay attacks, 3) an immediate response plus a delayed response from a thread
import hashlib
import hmac
import requests
import time
from flask import Flask, jsonify, request
from threading import Thread
app = Flask(__name__)

Keybase proof

I hereby claim:

  • I am jamiemhall on github.
  • I am jamiehall (https://keybase.io/jamiehall) on keybase.
  • I have a public key whose fingerprint is 9D10 1B2F B5D0 73FD 405A B5B8 1423 490A 004E 73E2

To claim this, I am signing this object: