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

store and check for authenticator token #4

Open
agau88 opened this issue May 7, 2024 · 0 comments
Open

store and check for authenticator token #4

agau88 opened this issue May 7, 2024 · 0 comments

Comments

@agau88
Copy link
Contributor

agau88 commented May 7, 2024

We noticed that the oauth endpoint for hubspot was being hit every time a request for records was made.

Inspecting client.py:

        while True:
            if not self.token:
                _logger.debug("acquiring authentication token")
                self.access_token = await self.authenticator(self.session)
            headers["Authorization"] = f"Bearer {self.access_token}"
            url = f"{self.endpoint}{path}"
            async with self.session.request(

self.token is checked for being not None, but the actual token info is stored in self.access_token. The variable self.access_token is only referenced in the blob above and should be changed to self.token (self.token is initialized)

We detected this issue by placing a print statement here, showing we were hitting this endpoint all the time.

json = await response.json()

We noticed that the code bit above would fail in weird ways intermittently (e.g., returning a non-json response or a server 500)

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