From 662f965ec63e6a9537b66873c42b41df71f57e3e Mon Sep 17 00:00:00 2001 From: James Read Date: Mon, 19 Feb 2024 21:00:40 +0800 Subject: [PATCH] Updating PSR name --- README.md | 23 ++++++++++++++--------- composer.json | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 84fe34c..ef513ba 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@ # PSR-7 and PSR-15 JWT Authentication Middleware > [!IMPORTANT] > This is a drop in replacement for `tuupola/slim-jwt-auth` with the updated version of `firebase/php-jwt` to resolve -> [CVE-2021-46743](https://nvd.nist.gov/vuln/detail/CVE-2021-46743) for the meantime I plan to maintiane conpatability in v1 -> V2 I plan to deverge - +> [CVE-2021-46743](https://nvd.nist.gov/vuln/detail/CVE-2021-46743) for the meantime I plan to maintiane conpatability in v1, +> v2 I plan to deverge This middleware implements JSON Web Token Authentication. It was originally developed for Slim but can be used with any framework using PSR-7 and PSR-15 style middlewares. It has been tested with [Slim Framework](http://www.slimframework.com/) and [Zend Expressive](https://zendframework.github.io/zend-expressive/). -[![Latest Version](https://img.shields.io/packagist/v/jimtools/slim-jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/slim-jwt-auth) -[![Packagist](https://img.shields.io/packagist/dm/jimtools/slim-jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/slim-jwt-auth) +[![Latest Version](https://img.shields.io/packagist/v/jimtools/jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/jwt-auth) +[![Packagist](https://img.shields.io/packagist/dm/jimtools/jwt-auth.svg?style=flat-square)](https://packagist.org/packages/jimtools/jwt-auth) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/github/actions/workflow/status/jimtools/slim-jwt-auth/tests.yml?branch=main&style=flat-square)](https://github.com/jimtools/slim-jwt-auth/actions) -[![Coverage](https://img.shields.io/codecov/c/gh/jimtools/slim-jwt-auth/main.svg?style=flat-square)](https://codecov.io/github/jimtools/slim-jwt-auth/branch/main) +[![Build Status](https://img.shields.io/github/actions/workflow/status/jimtools/jwt-auth/tests.yml?branch=main&style=flat-square)](https://github.com/jimtools/jwt-auth/actions) +[![Coverage](https://img.shields.io/codecov/c/gh/jimtools/jwt-auth/main.svg?style=flat-square)](https://codecov.io/github/jimtools/jwt-auth/branch/main) Heads up! You are reading documentation for [3.x branch](https://github.com/tuupola/slim-jwt-auth/tree/3.x) which is PHP 7.4 and up only. If you are using older version of PHP see the [2.x branch](https://github.com/tuupola/slim-jwt-auth/tree/2.x). These two branches are not backwards compatible, see [UPGRADING](https://github.com/tuupola/slim-jwt-auth/blob/main/UPGRADING.md) for instructions how to upgrade. @@ -20,12 +19,16 @@ Middleware does **not** implement OAuth 2.0 authorization server nor does it pro For example implementation see [Slim API Skeleton](https://github.com/tuupola/slim-api-skeleton). +## Breaking Channges +Because of the way firebase/php-jwt:v6 now works, the way `secrets` and `algorithm` are pass needs + to change + ## Install Install latest version using [composer](https://getcomposer.org/). ``` bash -$ composer require jimtools/slim-jwt-auth +$ composer require jimtools/jwt-auth ``` If using Apache add the following to the `.htaccess` file. Otherwise PHP wont have access to `Authorization: Bearer` header. @@ -141,7 +144,9 @@ When passing multiple algorithm it be a key value array, with the key being the $app = new Slim\App; $app->add(new Tuupola\Middleware\JwtAuthentication([ - "secret" => "supersecretkeyyoushouldnotcommittogithub", + "secret" => [ + "acme" => "supersecretkeyyoushouldnotcommittogithub", + "beta" => "supersecretkeyyoushouldnotcommittogithub", "algorithm" => [ "amce" => "HS256", "beta" => "HS384" diff --git a/composer.json b/composer.json index 604ddd2..057d936 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "jimtools/slim-jwt-auth", + "name": "jimtools/jwt-auth", "description": "Drop in replacement for tuupola/slim-jwt-auth", "keywords": [ "psr-7", @@ -9,7 +9,7 @@ "json", "auth" ], - "homepage": "https://github.com/tuupola/slim-jwt-auth", + "homepage": "https://github.com/jimtools/jwt-auth", "license": "MIT", "authors": [ {