web-token / jwt-framework

JWT Framework
MIT License
892 stars 106 forks source link

Symfony Flex recipe mentioned in docs does not exist #336

Closed msheakoski closed 2 years ago

msheakoski commented 2 years ago

Version(s) affected: 3.0.2

Description https://web-token.spomky-labs.com/the-symfony-bundle/symfony-bundle mentions that a Flex recipe that will automatically configure the bundle, however, there is no such recipe. An entry to bundles.php must be manually added as well as config/packages/jose.yaml

How to reproduce Run composer require web-token/jwt-bundle or composer require web-token/jwt-framework as instructed by the docs.

Possible Solution There are two possibilities to address this:

  1. Add the recipe to this repository and set extra.symfony.endpoint in composer.json to point to it according to https://symfony.com/blog/symfony-flex-is-going-serverless#custom-recipes or submit it as a PR to https://github.com/symfony/recipes-contrib

  2. Change the docs to explain that bundles.php must be modified and config/packages/jose.yaml must be created.

Spomky commented 2 years ago

You are right I missed some pieces of the puzzle. I will go to the solution 1.

Spomky commented 2 years ago

The documentation says the bundle is automatically enabled if you use symfony flex. This is still the case when installing web-token/jwt-bundle, but not for the complete suite web-token/jwt-framework.

Symfony operations: 1 recipe (f46cad8ae1095df5524e49f56e45777d)

  • Configuring web-token/jwt-bundle (>=v3.0.2): From auto-generated recipe

There is no jose.yaml configuration file provided (it was removed as per this comment). But now that flex is serverless, we can go as we want and it seems interesting to have configuration references in a jose.yaml file.

Spomky commented 2 years ago

Anyone familiar with the flex recipes here?

  1. I created a repository for the bundles: https://github.com/web-token/recipes
  2. This repository contains both the bundle and the framework rules as showed in the official Symfony Flex recipes repository (https://github.com/symfony/recipes/tree/flex/main)
  3. There is an index.json file
  4. The bundle and the framework composer.json files provide the correct repository URI (https://github.com/web-token/jwt-framework/blob/v3.0/composer.json#L151-L158)

I am sure it is not for from the working state, but I have no success at the moment.

Any thoughts on that?

Spomky commented 2 years ago

This is working fine now. Your project has to be updated. Please have a look at the documentation I've just updated.

You have to execute the following command in your project root:

composer config --json extra.symfony.endpoint '["https://api.github.com/repos/web-token/recipes/contents/index.json", "flex://defaults"]'

Let me know if you have any trouble.

github-actions[bot] commented 8 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.