Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Client' object has no attribute 'webhooks' #100

Closed
Jlawlzz opened this issue Nov 9, 2021 · 2 comments
Closed

AttributeError: 'Client' object has no attribute 'webhooks' #100

Jlawlzz opened this issue Nov 9, 2021 · 2 comments

Comments

@Jlawlzz
Copy link

Jlawlzz commented Nov 9, 2021

Reproduce

Call the workos_client.webhooks.verify_event as described in documentation

Our implementation:

...
from workos import client as workos_client

@hooks_bp.route('/workos_hook', methods=['POST'])
def workos_hook():
    data = request.get_json()
    sig_header = request.headers['WorkOS-Signature']

    try:
        workos_client.webhooks.verify_event(
            payload=data,
            sig_header=sig_header,
            secret=getenv('WORKOS_WEBHOOKS_SECRET')
        )
    except ValueError as e:
        raise e

    data = request.get_json()
    if data is None:
        raise ParabolaBadRequest('No data received')

    workos_webhook_helper.handle_webhook(data)

    return post_success_message()

Error

ERROR:parabola.routes.errors:A Wild Exception Appears!
api-server_1           | Traceback (most recent call last):
api-server_1           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1838, in full_dispatch_request
api-server_1           |     rv = self.dispatch_request()
api-server_1           |   File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1824, in dispatch_request
api-server_1           |     return self.view_functions[rule.endpoint](**req.view_args)
api-server_1           |   File "/app/parabola/helpers/analytics_helper.py", line 28, in decorator
api-server_1           |     return f(*args, **kwargs)
api-server_1           |   File "/app/parabola/routes/hooks.py", line 112, in workos_hook
api-server_1           |     workos_client.webhooks.verify_event(
api-server_1           | AttributeError: 'Client' object has no attribute 'webhooks'
@awolfden
Copy link
Contributor

awolfden commented Nov 9, 2021

Hey Jlawlzz - This bug was addressed in the latest release 1.5.1. Could you try updating to this latest version and see if you’re still running in to the error?

@Jlawlzz
Copy link
Author

Jlawlzz commented Nov 10, 2021

Yes that worked, thank you!

@Jlawlzz Jlawlzz closed this as completed Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants