Comments (2)
Ah I'm afraid we've only added it to the Ruby library so far - you're right, we need to add it to the Python library too.
https://github.com/clearbit/clearbit-ruby/blob/master/lib/clearbit/webhook.rb#L11
from clearbit-python.
FWIW, I think that this should be able to be accomplished in python as follows:
import hmac
import hashlib
...
signature = get_header(request, 'X-Request-Signature') # framework-specific way to get header from request...
body = get_body(request) # framework-specific way to get raw body from request...
signature_check = 'sha1=' + hmac.new('clearbit-api-key', body, hashlib.sha1).hexdigest()
if not hmac.compare_digest(signature, signature_check):
# Attacker!!!!
Unfortunately, hmac.compare_digest
wasn't added until python2.7.7 -- Older versions will need to fall back on the less secure if signature != signature_check: ...
from clearbit-python.
Related Issues (15)
- The package is unusable if installed via setup.py because enrichment is not added to the dist
- **attrs ignored in Person.flag
- Discover API errors with unexpected keyword argument 'json' HOT 5
- Use timeouts
- TypeError: sequence item 0: expected string, NoneType found
- No example for company name to domain HOT 1
- python api inconsistent with docs
- Is it possible to pass in the API-Version when using the Clearbit Python library? HOT 1
- Issue with HTTPError exception Handling
- Problems when querying.
- clearbit fails to install with setuptools 58.* HOT 1
- On a multi-thread context, the use of this method could lead to "HTTPSConnectionPool ... Max retries exceeded with url..."
- Pip install error exit status 1 with Clearbit API HOT 1
- Resource.get overlaps dict.get method HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clearbit-python.