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

Do not deprecate the support for PSR-18 HTTP clients #534

Open
Cyperghost opened this issue Feb 28, 2024 · 1 comment
Open

Do not deprecate the support for PSR-18 HTTP clients #534

Cyperghost opened this issue Feb 28, 2024 · 1 comment
Labels

Comments

@Cyperghost
Copy link

Description

if ($this->client instanceof ClientInterface) {
trigger_deprecation(
'web-token/jwt-library',
'3.3',
'Using "%s" with an instance of "%s" is deprecated, use "%s" instead.',
self::class,
ClientInterface::class,
HttpClientInterface::class
);
}

In our application we use Guzzle and not any feature of Symfony. Is there any point that you can support PSR-18 HTTP clients too?

It would be good to have the same solutions as web-auth/webauthn-framework#482
Another solution would be to move UrlKeySetFactory to the bundle.

Example

No response

@Spomky
Copy link
Member

Spomky commented Feb 28, 2024

Hi,

Actually, the JKUFactory and the X5UFactory can be easily extended to be used with any HTTP Client.
In version 4.0, symfony/http-client will be mandatory only if you use the classes, but you are free to implement your own class.

namespace Acme;

use GuzzleHttp\Client;
use Jose\Component\KeyManagement\JKUFactory;

final class GuzzleJKUFactory extends JKUFactory
 {
    pulbic function __construct(private readonly Client $client) {}

    /**
     * @param array<string, string|string[]> $header
     */
    protected function getContent(string $url, array $header = []): string
    {
        //Place Guzzle calls here
        $this->client->request(...
    }
}

@Spomky Spomky added the wontfix label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants