belong-inc / go-hubspot

HubSpot API Go client
Apache License 2.0
35 stars 26 forks source link

Allow use of private app for authentication #10

Closed thenoakes closed 2 years ago

thenoakes commented 2 years ago

What to do

This PR introduces an Authenticator which simply sets an access token from a configured private app, so that it can be passed in the Authorisation header with requests. This is called out in issue #8 and mentioned in the repo's readme.

Background

I'm proposing this change because it is already called out as a change that would be desirable. I find this library useful, and as the linked issue explains, API keys will be deprecated next month so I decided to add this capability to ensure continued use. Hubspot private app docs

Acceptance criteria

This PR should successfully allow any interaction with the HubSpot API that currently works with an API key, with a private app access token configured with the same scopes.

This would be my first contribution to open source software, please be kind :)

kk-no commented 2 years ago

@thenoakes Thank you for your PR! Let me check the impl and behavior.

kk-no commented 2 years ago

@thenoakes Thank you for your improvement! We plan to release it in the next v0.3.0 version.