-
Notifications
You must be signed in to change notification settings - Fork 30
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
In light of private apps requirement, modified code to support Bearer token authentication #93
Conversation
Thank you very much for the contribution! Have you tested it locally with an API token of your own? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall OK, one comment about making this non-breaking.
I will submit a PR that you'll have to rebase with that will make a new API token available to test tests.
edit
@alexcrowdpharm my PR has been merged, please rebase with master
|
||
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _apiToken); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to make this a non-breaking change. I know that Hubspot will effectively stop allowing the apiKey from 30'th Nov, but since we're still in 0.x semver, the breaking change might be missed by people upgrading.
It seems like the new private app keys start with pat-
, so I think that we could do a check on this and then either attach the Authorization
header, or use the SetQueryParam
to use the legacy auth mode. Which should then issue a Warning
via the logger - that the legacy auth is used which will be removed Dec 2022.
chore: prepare tests for bearer token auth (skarpdev#94)
Hi @alexcrowdpharm, just a general question... any specific reason for switching to .NET 5? Since it's out of official support since May 2022, I doubt we should want this. |
I agree here, if anything we should remove it and keep the remainder. It was multi-targeted on purpose so please bring it back 😊 Also, if you feel we're asking too much let me know and I'll be happy to adopt your changes and get it ready for merging ❤️ |
Hello Skarp Team. I made this change for a couple of reasons:
|
|
@alexcrowdpharm I have taken the liberty of cherry-picking your first commit and then applying my suggestions to it (making it non breaking) in a new PR. I will therefore close this PR but ensure that you'll be co-authored on the new PR. Thanks for your contribution :) |
Modified as per HubSpot requirement. From their announcement:
"On June 1, 2022, we published a changelog update and Community blog post announcing an important change to API Keys. With this change, you’ll need to migrate existing integrations from using HubSpot API Key authentication to Private Apps by November 30, 2022."