Giter VIP home page Giter VIP logo

api-python-client's People

Contributors

ciaran16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-python-client's Issues

Code examples for webhook authentication

Hi, I am currently using the following to verify the X_Signature on the requests sent to our webhooks endpoint, however it is failing. I feel the documentation is not super clear on it, for instance does 'complete event payload' mean the payload part of the json object, or does it mean the full body of the request? Below is the code I am attempting to use at the moment however it is failing. If you could provide some example code or point out what I am doing wrong that would be great.

    import hashlib
    import hmac
    import base64
    # secret token as shown on the webhooks section of the dashboard
    key = bytes(ck, 'utf-8')
    
    # body = bytes(json.dumps(json.loads(body.decode())['payload']), 'utf-8')
    message = body # request.body

    digester = hmac.new(key=key, msg=message, digestmod=hashlib.sha3_224)

    signature = digester.digest()

    signature = base64.b64encode(signature).decode()

    return signature

Syntax error on python 3.7.0

I get the following with python 3.7.0 (3.6.6 works fine):

Python 3.7.0 (default, Jun 28 2018, 13:15:42) 
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onfido
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cris/.conda/envs/tge_dev/lib/python3.7/site-packages/onfido/__init__.py", line 28, in <module>
    from .models.address import Address
  File "/home/cris/.conda/envs/tge_dev/lib/python3.7/site-packages/onfido/models/__init__.py", line 32, in <module>
    from .check_creation_request import CheckCreationRequest
  File "/home/cris/.conda/envs/tge_dev/lib/python3.7/site-packages/onfido/models/check_creation_request.py", line 35
    def __init__(self, type=None, redirect_uri=None, reports=None, report_type_groups=None, criminal_history_report_details=None, tags=None, suppress_form_emails=None, charge_applicant_for_check=None, brand_id=None, async=None):
                                                                                                                                                                                                                            ^
SyntaxError: invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.