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

create_hook doesn't work when oauth is not used #299

Open
yannrouillard opened this issue Dec 14, 2019 · 0 comments
Open

create_hook doesn't work when oauth is not used #299

yannrouillard opened this issue Dec 14, 2019 · 0 comments

Comments

@yannrouillard
Copy link

Currently where using the TrelloClient create_hook method without oauth enabled, the method doesn't work because of a missing authentication.

See https://github.com/sarumont/py-trello/blob/master/trello/trelloclient.py#L277

        response = self.http_service.post(url, data=data, auth=self.oauth, proxies=self.proxies)

The HTTP call only include the self.oauth auth info if present but doesn't include the api key and token through query params if oauth is not used.

Note that create_hook uses not the same code as other function (because of some bugs encountered in the past), however we fully replaced it with fetch_json as a workaround without issue so maybe there is no more need for this particularity.

Code we used:

        return self.trello_client.fetch_json(
            f"tokens/{self.trello_token}/webhooks/",
            http_method="POST",
            post_args={
                "callbackURL": self.callback_url,
                "idModel": card.id,
                "description": self.callback_desc,
            }
        )
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

1 participant