lexik/LexikJWTAuthenticationBundle

Trying to instanciate an interface in LcobucciJWSProvider

Kern046 opened this issue · 5 comments

In LcobucciJWSProvider.l105, there is a new instanciation of Lcobucci\JWT\Builder. But Builder is an interface. So this line would trigger an error if Lcobucci\JWT\Token\Builder were to be unavailable.

Is it still relevant to control the existence of Lcobucci\JWT\Token\Builder ? If yes, what would be the alternative for Lcobucci\JWT\Builder instanciation ?

I'm ready to make a PR about it either to remove this condition or change the else statement :).

Do you actually face a bug in this code? IIRC, Builder is instantiable when the JWTBuilder class does not exist (= old version where it was still a class)

Of course it might be broken :) we would need a failing test case

Do you actually face a bug in this code? IIRC, Builder is instantiable when the JWTBuilder class does not exist (= old version where it was still a class)

I don't ! I was just visiting the code and saw this :). If it's for compatibility with older versions then it's legit I guess, as long as the change for Builder becoming an interface is in the same version as JWTBuildercreation.

That’s the case, all good then. Thanks!

(Don't feel embarrassed, these changes on the underlying lib are very hard to keep up with)