From 9fdecab5ce049b70f7b3bc490b3802c889410ab3 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Tue, 25 Apr 2017 10:45:58 +0200 Subject: [PATCH] Add LexikJWTAuthenticationBundle for JWT Authentication in Symfony --- lexik/jwt-authentication-bundle/2.3/Makefile | 8 ++++++++ .../2.3/etc/packages/lexik_jwt_authentication.yaml | 4 ++++ lexik/jwt-authentication-bundle/2.3/manifest.json | 13 +++++++++++++ .../jwt-authentication-bundle/2.3/post-install.txt | 1 + 4 files changed, 26 insertions(+) create mode 100644 lexik/jwt-authentication-bundle/2.3/Makefile create mode 100644 lexik/jwt-authentication-bundle/2.3/etc/packages/lexik_jwt_authentication.yaml create mode 100644 lexik/jwt-authentication-bundle/2.3/manifest.json create mode 100644 lexik/jwt-authentication-bundle/2.3/post-install.txt diff --git a/lexik/jwt-authentication-bundle/2.3/Makefile b/lexik/jwt-authentication-bundle/2.3/Makefile new file mode 100644 index 00000000..e4b9167c --- /dev/null +++ b/lexik/jwt-authentication-bundle/2.3/Makefile @@ -0,0 +1,8 @@ +generate-jwt-keys: +ifeq (, $(shell which openssl)) +$(error "Unable to generate keys (needs OpenSSL)") +endif + mkdir -p etc/jwt + openssl genrsa -passout pass:${JWT_PASSPHRASE} -out ${JWT_PRIVATE_KEY_PATH} -aes256 4096 + openssl rsa -passin pass:${JWT_PASSPHRASE} -pubout -in ${JWT_PRIVATE_KEY_PATH} -out ${JWT_PUBLIC_KEY_PATH} + @echo "\033[32mRSA key pair successfully generated\033[39m" diff --git a/lexik/jwt-authentication-bundle/2.3/etc/packages/lexik_jwt_authentication.yaml b/lexik/jwt-authentication-bundle/2.3/etc/packages/lexik_jwt_authentication.yaml new file mode 100644 index 00000000..bfc8351e --- /dev/null +++ b/lexik/jwt-authentication-bundle/2.3/etc/packages/lexik_jwt_authentication.yaml @@ -0,0 +1,4 @@ +lexik_jwt_authentication: + private_key_path: "%env(JWT_PRIVATE_KEY_PATH)%" + public_key_path: "%env(JWT_PUBLIC_KEY_PATH)%" + pass_phrase: "%env(JWT_PASSPHRASE)%" diff --git a/lexik/jwt-authentication-bundle/2.3/manifest.json b/lexik/jwt-authentication-bundle/2.3/manifest.json new file mode 100644 index 00000000..a6881c27 --- /dev/null +++ b/lexik/jwt-authentication-bundle/2.3/manifest.json @@ -0,0 +1,13 @@ +{ + "bundles": { + "Lexik\\Bundle\\JWTAuthenticationBundle\\LexikJWTAuthenticationBundle": ["all"] + }, + "copy-from-recipe": { + "etc/": "%ETC_DIR%" + }, + "env": { + "JWT_PRIVATE_KEY_PATH": "%ETC_DIR%/jwt/private.pem", + "JWT_PUBLIC_KEY_PATH": "%ETC_DIR%/jwt/public.pem", + "JWT_PASSPHRASE": "%generate(secret)%" + } +} diff --git a/lexik/jwt-authentication-bundle/2.3/post-install.txt b/lexik/jwt-authentication-bundle/2.3/post-install.txt new file mode 100644 index 00000000..f471977e --- /dev/null +++ b/lexik/jwt-authentication-bundle/2.3/post-install.txt @@ -0,0 +1 @@ +Now, run make generate-jwt-keys to generate a key pair for LexikJWTAuthenticationBundle.