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

[5.1.0 -> 5.2.0] Argument $logger no more existing in Auth0\Symfony\Service #173

Closed
4 tasks done
fullmoonissue opened this issue Dec 13, 2023 · 4 comments · Fixed by #174
Closed
4 tasks done

[5.1.0 -> 5.2.0] Argument $logger no more existing in Auth0\Symfony\Service #173

fullmoonissue opened this issue Dec 13, 2023 · 4 comments · Fixed by #174

Comments

@fullmoonissue
Copy link

fullmoonissue commented Dec 13, 2023

Checklist

  • I have looked into the Readme and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

Hi 👋,

Thanks for the lastest release taking care of Sf v6.4.

Dependabot has tried to upgrade the auth0/symfony package from 5.1.0 to 5.2.0 but this error is encountered in the CI.

In ResolveNamedArgumentsPass.php line 87:

  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
  Invalid service "auth0": method "Auth0\Symfony\Service::__construct()" has no argument named "$logger". Check your service definition.

Checking the compare between the two versions, we can see that the argument $logger has been removed from the class Service (cf) but it has been kept in the service definition (cf).

Locally, when removing the $logger argument inside the Auth0Bundle from the Service class (and rebuild the symfony cache), the same error appears for the Auth0\Symfony\Security\Authenticator, Auth0\Symfony\Stores\SessionStore and Auth0\Symfony\Security\Authorizer too.

After removing all the $logger arguments from the definitions, a new error appears : Invalid service "Auth0\Symfony\Security\UserProvider": class has no constructor., so I've added a __construct() method like this :

    public function __construct(
        private Service $service,
    )
    {
    }

After those updates, the cache clears.

Do I mistaken about the spotted errors ?

If desired, I can make a PR with the mentioned updates.

Kind regards,

Reproduction

Trying to upgrade from the version 5.1.0 to 5.2.0.

Additional context

No response

jwt-auth-bundle version

5.2.0

Symfony version

6.4.1

PHP version

8.2.11

@evansims
Copy link
Member

evansims commented Dec 14, 2023

Hi @fullmoonissue 👋 Thanks for reporting this! Looks like some things got caught up in an overzealous Rector rule, with the new code styling getting applied. Apologies for not catching that. I'll get a fix going right away.

@evansims
Copy link
Member

evansims commented Dec 14, 2023

👋 Could you give b752dcc a look and see if that resolves all the inadvertent method signature alterations you identified? It might be worth pointing your composer entry for the SDK to the https://github.com/auth0/symfony/tree/fix/rector-signature-changes branch and trying it out, just to be sure.

@fullmoonissue
Copy link
Author

Hi @evansims,

Thanks for the quick reply.

Indeed, when branching on dev-fix/rector-signature-changes from composer there's no more issue afterwards, nice.

It's a ✅ on my side.

@evansims
Copy link
Member

Excellent, thanks so much for confirming that for me! I'll get a patch release going with that fix right now

evansims added a commit that referenced this issue Dec 15, 2023
### Changes

5.2.0 inadvertently altered some method signatures due to new code
styling tooling rules; this restores those methods to their previous
state, to avoid introducing breaking changes.

### References

Resolves #173 

### Testing

N/A

### Checklist

- [x] I have read the [Auth0 general contribution
guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [x] I have read the [Auth0 Code of
Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [x] All existing and new tests complete without errors
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 a pull request may close this issue.

2 participants