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

In light of private apps requirement, modified code to support Bearer token authentication #93

Closed
wants to merge 5 commits into from

Conversation

alexcrowdpharm
Copy link
Contributor

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."

@nover
Copy link
Contributor

nover commented Aug 17, 2022

Thank you very much for the contribution!

Have you tested it locally with an API token of your own? :)

Copy link
Contributor

@nover nover left a 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

Comment on lines +269 to +271

request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _apiToken);

Copy link
Contributor

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.

@roycornelissen
Copy link
Collaborator

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.

@nover
Copy link
Contributor

nover commented Sep 30, 2022

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 ❤️

@alexcrowdpharm
Copy link
Contributor Author

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:

  1. .NET 6 was only targeted in the unit test projects, but not the main code projects; and
  2. In a CI scenario, especially when using the dotnet ef command-line tools, only one .NET version can be installed, and it has to apply to all projects in the solution. Our CI build was failing due to the targeting of .NET 6 in these unit test projects.

@nover
Copy link
Contributor

nover commented Oct 12, 2022

Hello Skarp Team. I made this change for a couple of reasons:

  1. .NET 6 was only targeted in the unit test projects, but not the main code projects; and
  2. In a CI scenario, especially when using the dotnet ef command-line tools, only one .NET version can be installed, and it has to apply to all projects in the solution. Our CI build was failing due to the targeting of .NET 6 in these unit test projects.
  1. The main project is in fact multi-targeting <TargetFrameworks>netstandard2.0;net461;net5.0;net6.0</TargetFrameworks> and so should the test-suites in order to verify whether some of the framework targets have problems.
  2. Once you get this shipped properly via nuget it will install the most appropriate version for you and no problems will arise.

@nover
Copy link
Contributor

nover commented Oct 26, 2022

@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 :)

@nover nover closed this Oct 26, 2022
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

Successfully merging this pull request may close these issues.

3 participants