XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
92 stars 66 forks source link

Installation fails due to incompatibility with already-installed firebase/php-jwt #278

Closed danhobbs75 closed 2 years ago

danhobbs75 commented 2 years ago

Attempting to install latest version

Describe the bug Installation fails because it depends on firebase/php-jwt ^5.0, but I am already using a later version of that (6.1.2).

To Reproduce Steps to reproduce the behavior:

  1. Install firebase/php-jwt (composer require firebase/php-jwt)
  2. Install xeroapi/xero-php-oauth2 (composer require xeroapi/xero-php-oauth2)
  3. See error below

Expected behavior Installation expected.

Screenshots Not a screenshot, but here is the text shown by composer:

Info from https://repo.packagist.org: #StandWithUkraine Using version ^2.13 for xeroapi/xero-php-oauth2 ./composer.json has been updated Running composer update xeroapi/xero-php-oauth2 Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

Additional context There is a small API change in firebase/php-jwt which means the dependency must also move up and it can't be backwards compatible once you make that change.

I'm going to look to see if I can do the code change for you but if this is something you already know about it might be easier for you to do it.

danhobbs75 commented 2 years ago

OK, I have looked at the code and I don't believe there are any code changes to make. I think it can be allowed to depend on firebase/php-jwt ^6.0 as well.

Here's the breaking change I hit in the release notes: https://github.com/firebase/php-jwt/releases/tag/v6.0.0

I was using a single key which is why I had to change my code. You have used a key set, and the requirement is that it contains the property "alg", and I can see that it does by looking here: https://identity.xero.com/.well-known/openid-configuration/jwks

So I believe your existing code will work.

I think the only change necessary is in composer.json to allow firebase/php-jwt to be ^5.0 | ^6.0. But this is now beyond me, so I hope you're able to make this change.

If there is another workaround I'm missing to be able to install this, please let me know. I think at the moment I can't use this library though.

RettBehrens commented 2 years ago

looking to resolve with #281

pumpkinball commented 2 years ago

Deployed on latest release 2.14.0