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

Add a override-encoder configuration in the bundle #76

Open
wants to merge 1 commit into
base: v4.0
Choose a base branch
from

Conversation

romainneutron
Copy link

Q A
Branch? 4.0
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no

In some cases, it might be very useful to use the Jose encoder as a service in a custom authenticator, and not substitute the Lexik one with it.
Here's a use case:

  • I develop an app that use Lexik bundle to encode / decode some JWT token to let the UI deal with the backend
  • The backend also consumes a third party API, using JWKS. Lexik Jose Bridge is quite awesome becomes it brings the Jose decoder correctly plugged, with all the awesome expected features
  • I dont want the JWKS Jose decoder configured for the third party API to replace the Lexik encoder

This PR proposes to introduce a substitute boolean configuration to optionally disable service configuration in the lexik bundle

@chalasr
Copy link
Collaborator

chalasr commented Jun 6, 2023

Looks sensible 👍 It's not obvious what substitute means, finding something a bit more self-explanatory would be nice.

@Spomky
Copy link
Member

Spomky commented Jun 6, 2023

I had in mind that the configuration file takes priority over the prepended one. Am I wrong?

Anyhow, I agree with @chalasr and substitue does not seem appropriate. What about override-encoder?

@romainneutron
Copy link
Author

Hello, comments addressed, PR updated

@romainneutron romainneutron changed the title Add a substitute configuration in the bundle Add a override-encoder configuration in the bundle Jun 8, 2023
@romainneutron
Copy link
Author

Hello !
Any news on this ?

@Spomky
Copy link
Member

Spomky commented Jun 26, 2023

Hi,

Excuse me, I was busy past weeks.
What I tried to point out with the configuration file takes priority over the prepended is that, if you set the default encoder in the configuration file, the bridge will still create the service, but the one you choose will be used.
There is no need for adding this modification.

lexik_jwt_authentication:
    encoder:
        service: lexik_jwt_authentication.encoder.lcobucci # Default LexikJWTAuthenticationBundle encoder
    # ...

lexik_jose:
    # bundle configuration here
    # ...

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