From e85d0fe564ec20ffe2fb70e7b89ed1ded510666f Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Fri, 4 Sep 2026 14:41:24 +0200 Subject: [PATCH] [league/oauth2-server-bundle] Add v1.2 recipe (#1550) --- .../config/packages/league_oauth2_server.yaml | 30 +++++++++++++++++++ .../config/routes/league_oauth2_server.yaml | 3 ++ league/oauth2-server-bundle/1.2/manifest.json | 18 +++++++++++ .../oauth2-server-bundle/1.2/post-install.txt | 8 +++++ 4 files changed, 59 insertions(+) create mode 100644 league/oauth2-server-bundle/1.2/config/packages/league_oauth2_server.yaml create mode 100644 league/oauth2-server-bundle/1.2/config/routes/league_oauth2_server.yaml create mode 100644 league/oauth2-server-bundle/1.2/manifest.json create mode 100644 league/oauth2-server-bundle/1.2/post-install.txt diff --git a/league/oauth2-server-bundle/1.2/config/packages/league_oauth2_server.yaml b/league/oauth2-server-bundle/1.2/config/packages/league_oauth2_server.yaml new file mode 100644 index 00000000..a617c09d --- /dev/null +++ b/league/oauth2-server-bundle/1.2/config/packages/league_oauth2_server.yaml @@ -0,0 +1,30 @@ +league_oauth2_server: + authorization_server: + private_key: '%env(resolve:OAUTH_PRIVATE_KEY)%' + private_key_passphrase: '%env(resolve:OAUTH_PASSPHRASE)%' + encryption_key: '%env(resolve:OAUTH_ENCRYPTION_KEY)%' + # Both grants are disabled by default and will be removed in 2.0. Enable them only if you need them. + enable_password_grant: false + enable_implicit_grant: false + resource_server: + public_key: '%env(resolve:OAUTH_PUBLIC_KEY)%' + scopes: + available: ['email'] + default: ['email'] + persistence: + doctrine: null + client: + # Store client secrets hashed. Set to true only to keep supporting legacy plaintext secrets. + allow_plaintext_secrets: false + +when@test: + league_oauth2_server: + persistence: + in_memory: null + + services: + # Use the lowest bcrypt cost to speed up client secret hashing in tests. + league.oauth2_server.password_hasher: + class: Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher + arguments: + $cost: 4 # Lowest possible value for bcrypt diff --git a/league/oauth2-server-bundle/1.2/config/routes/league_oauth2_server.yaml b/league/oauth2-server-bundle/1.2/config/routes/league_oauth2_server.yaml new file mode 100644 index 00000000..38a4d1b9 --- /dev/null +++ b/league/oauth2-server-bundle/1.2/config/routes/league_oauth2_server.yaml @@ -0,0 +1,3 @@ +league_oauth2_server: + resource: '@LeagueOAuth2ServerBundle/config/routes.php' + type: php diff --git a/league/oauth2-server-bundle/1.2/manifest.json b/league/oauth2-server-bundle/1.2/manifest.json new file mode 100644 index 00000000..71be019c --- /dev/null +++ b/league/oauth2-server-bundle/1.2/manifest.json @@ -0,0 +1,18 @@ +{ + "bundles": { + "League\\Bundle\\OAuth2ServerBundle\\LeagueOAuth2ServerBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "OAUTH_PRIVATE_KEY": "%kernel.project_dir%/%CONFIG_DIR%/jwt/private.pem", + "OAUTH_PUBLIC_KEY": "%kernel.project_dir%/%CONFIG_DIR%/jwt/public.pem", + "OAUTH_PASSPHRASE": "%generate(secret)%", + "OAUTH_ENCRYPTION_KEY": "%generate(secret)%" + }, + "gitignore": [ + "/%CONFIG_DIR%/jwt/*.pem" + ], + "aliases": ["oauth2-server", "oauth-server"] +} diff --git a/league/oauth2-server-bundle/1.2/post-install.txt b/league/oauth2-server-bundle/1.2/post-install.txt new file mode 100644 index 00000000..1eba7a5a --- /dev/null +++ b/league/oauth2-server-bundle/1.2/post-install.txt @@ -0,0 +1,8 @@ + 1. Provide a key pair + * Generate a private/public key pair by running php bin/console league:oauth2-server:generate-keypair + + 2. Update the database schema + * Update your database schema so that bundle entities can be managed by Doctrine + + 3. Read the docs + * Read the documentation at https://github.com/thephpleague/oauth2-server-bundle/blob/master/docs/index.md