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

Key provided is shorter than 256 bits, only 80 bits provided #890

Closed
Lenny4 opened this issue Aug 28, 2022 · 7 comments
Closed

Key provided is shorter than 256 bits, only 80 bits provided #890

Lenny4 opened this issue Aug 28, 2022 · 7 comments
Assignees

Comments

@Lenny4
Copy link

Lenny4 commented Aug 28, 2022

Hello,

Here is my implementation:

<?php

namespace App\Service;

use Lcobucci\JWT\Configuration;
use Lcobucci\JWT\Signer\Hmac\Sha256;
use Lcobucci\JWT\Signer\Key\InMemory;

class MyCustomService
{
    public function getTokenMercure(): ?string
    {
        $configuration = Configuration::forSymmetricSigner(
            new Sha256(),
            InMemory::plainText('!ChangeMe!')
        );
        return $configuration->builder()
            ->withClaim('mercure', ['subscribe' => '/api/establishments/1'])
            ->getToken($configuration->signer(), $configuration->signingKey())
            ->toString();
    }
}

After upgrading from 4.1.5 to 4.2.1 I got this error:

Error details
{
  "@context": "\/contexts\/Error",
  "@type": "hydra:Error",
  "hydra:title": "An error occurred",
  "hydra:description": "Key provided is shorter than 256 bits, only 80 bits provided",
  "trace": [
    {
      "namespace": "",
      "short_class": "",
      "class": "",
      "type": "",
      "function": "",
      "file": "\/srv\/api\/vendor\/lcobucci\/jwt\/src\/Signer\/InvalidKeyProvided.php",
      "line": 39,
      "args": []
    },
    {
      "namespace": "Lcobucci\\JWT\\Signer",
      "short_class": "InvalidKeyProvided",
      "class": "Lcobucci\\JWT\\Signer\\InvalidKeyProvided",
      "type": "::",
      "function": "tooShort",
      "file": "\/srv\/api\/vendor\/lcobucci\/jwt\/src\/Signer\/Hmac.php",
      "line": 19,
      "args": [
        [
          "integer",
          256
        ],
        [
          "integer",
          80
        ]
      ]
    },
    {
      "namespace": "Lcobucci\\JWT\\Signer",
      "short_class": "Hmac",
      "class": "Lcobucci\\JWT\\Signer\\Hmac",
      "type": "-\u003E",
      "function": "sign",
      "file": "\/srv\/api\/vendor\/lcobucci\/jwt\/src\/Token\/Builder.php",
      "line": 119,
      "args": [
        [
          "string",
          "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyIvYXBpL2VzdGFibGlzaG1lbnRzLzEiXX19"
        ],
        [
          "object",
          "Lcobucci\\JWT\\Signer\\Key\\InMemory"
        ]
      ]
    },
    {
      "namespace": "Lcobucci\\JWT\\Token",
      "short_class": "Builder",
      "class": "Lcobucci\\JWT\\Token\\Builder",
      "type": "-\u003E",
      "function": "getToken",
      "file": "\/srv\/api\/src\/Service\/UserService.php",
      "line": 179,
      "args": [
        [
          "object",
          "Lcobucci\\JWT\\Signer\\Hmac\\Sha256"
        ],
        [
          "object",
          "Lcobucci\\JWT\\Signer\\Key\\InMemory"
        ]
      ]
    },
    {
      "namespace": "App\\Service",
      "short_class": "UserService",
      "class": "App\\Service\\UserService",
      "type": "-\u003E",
      "function": "getTokenMercure",
      "file": "\/srv\/api\/src\/Controller\/User\/UserWaiterController.php",
      "line": 30,
      "args": [
        [
          "object",
          "App\\Entity\\User"
        ],
        [
          "integer",
          1
        ]
      ]
    },
    {
      "namespace": "App\\Controller\\User",
      "short_class": "UserWaiterController",
      "class": "App\\Controller\\User\\UserWaiterController",
      "type": "-\u003E",
      "function": "__invoke",
      "file": "\/srv\/api\/vendor\/symfony\/http-kernel\/HttpKernel.php",
      "line": 153,
      "args": [
        [
          "string",
          "1"
        ],
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ],
        [
          "object",
          "App\\Service\\UserService"
        ],
        [
          "object",
          "App\\Repository\\EstablishmentRepository"
        ],
        [
          "object",
          "Symfony\\Component\\Serializer\\Serializer"
        ],
        [
          "object",
          "App\\Repository\\User\\WaiterConfigurationRepository"
        ]
      ]
    },
    {
      "namespace": "Symfony\\Component\\HttpKernel",
      "short_class": "HttpKernel",
      "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
      "type": "-\u003E",
      "function": "handleRaw",
      "file": "\/srv\/api\/vendor\/symfony\/http-kernel\/HttpKernel.php",
      "line": 75,
      "args": [
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ],
        [
          "integer",
          1
        ]
      ]
    },
    {
      "namespace": "Symfony\\Component\\HttpKernel",
      "short_class": "HttpKernel",
      "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
      "type": "-\u003E",
      "function": "handle",
      "file": "\/srv\/api\/vendor\/symfony\/http-kernel\/Kernel.php",
      "line": 202,
      "args": [
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ],
        [
          "integer",
          1
        ],
        [
          "boolean",
          true
        ]
      ]
    },
    {
      "namespace": "Symfony\\Component\\HttpKernel",
      "short_class": "Kernel",
      "class": "Symfony\\Component\\HttpKernel\\Kernel",
      "type": "-\u003E",
      "function": "handle",
      "file": "\/srv\/api\/vendor\/symfony\/http-kernel\/HttpKernelBrowser.php",
      "line": 65,
      "args": [
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ],
        [
          "integer",
          1
        ],
        [
          "boolean",
          true
        ]
      ]
    },
    {
      "namespace": "Symfony\\Component\\HttpKernel",
      "short_class": "HttpKernelBrowser",
      "class": "Symfony\\Component\\HttpKernel\\HttpKernelBrowser",
      "type": "-\u003E",
      "function": "doRequest",
      "file": "\/srv\/api\/vendor\/symfony\/framework-bundle\/KernelBrowser.php",
      "line": 172,
      "args": [
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ]
      ]
    },
    {
      "namespace": "Symfony\\Bundle\\FrameworkBundle",
      "short_class": "KernelBrowser",
      "class": "Symfony\\Bundle\\FrameworkBundle\\KernelBrowser",
      "type": "-\u003E",
      "function": "doRequest",
      "file": "\/srv\/api\/vendor\/symfony\/browser-kit\/AbstractBrowser.php",
      "line": 370,
      "args": [
        [
          "object",
          "Symfony\\Component\\HttpFoundation\\Request"
        ]
      ]
    },
    {
      "namespace": "Symfony\\Component\\BrowserKit",
      "short_class": "AbstractBrowser",
      "class": "Symfony\\Component\\BrowserKit\\AbstractBrowser",
      "type": "-\u003E",
      "function": "request",
      "file": "\/srv\/api\/vendor\/api-platform\/core\/src\/Bridge\/Symfony\/Bundle\/Test\/Client.php",
      "line": 123,
      "args": [
        [
          "string",
          "GET"
        ],
        [
          "string",
          "http:\/\/caddy\/api\/users\/waiter\/establishments\/1"
        ],
        [
          "array",
          []
        ],
        [
          "array",
          []
        ],
        [
          "array",
          {
            "HTTP_USER_AGENT": [
              "string",
              "Symfony BrowserKit"
            ],
            "CONTENT_TYPE": [
              "string",
              "application\/json"
            ],
            "HTTP_ACCEPT": [
              "string",
              "application\/ld+json"
            ],
            "HTTP_AUTHORIZATION": [
              "string",
              "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NjE2NDQ1NDMsImV4cCI6MTY2MjI0OTM0Mywicm9sZXMiOlsiUk9MRV9TVVBFUl9BRE1JTiJdLCJlbWFpbCI6IlJPTEVfU1VQRVJfQURNSU5OT1RfRFVNTVlAMS5jb20ifQ.I4-XsFpmOtXkVdEYqmVA9hcrYtvraw7nBk8gYfd-Lp94t0yY7qVkaYJHAvSUSd0W1XBqz5qiyft741b8hgaKHbCxvKmykW79z2fA1la0xE3sTuz8ED1rT0kya4JwPkbxikK0BPon5eqimtD8kf5GzZfqdtoetHRE4EmaR9cuY4myJnz0sYsl6OGZu81FUhlSsluFEcEuz29FTE8bU92UYxnzSUAbTsD6Xpwl95XQwK0De3I0mpW4pfl8u3KuSSvTYNIk9kTHV5j6C8N92sq_vuym-l4Njth8q0dRgwzK4eXAMqZOEhYZCwoT_WPgX9so5LaE4fwVjGXRgHR9gVuc6g"
            ],
            "HTTP_HOST": [
              "string",
              "caddy"
            ],
            "HTTPS": [
              "boolean",
              false
            ]
          }
        ],
        [
          "string",
          ""
        ]
      ]
    },
    {
      "namespace": "ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\Test",
      "short_class": "Client",
      "class": "ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\Test\\Client",
      "type": "-\u003E",
      "function": "request",
      "file": "\/srv\/api\/tests\/Api\/Voter\/Generated\/UserVoterTest.php",
      "line": 419,
      "args": [
        [
          "string",
          "GET"
        ],
        [
          "array",
          {
            "scheme": [
              "string",
              "http:"
            ],
            "authority": [
              "string",
              "\/\/caddy"
            ],
            "path": [
              "string",
              "\/api\/users\/waiter\/establishments\/1"
            ],
            "query": [
              "null",
              null
            ],
            "fragment": [
              "null",
              null
            ]
          }
        ],
        [
          "array",
          {
            "normalized_headers": [
              "array",
              {
                "content-type": [
                  "array",
                  [
                    [
                      "string",
                      "Content-Type: application\/json"
                    ]
                  ]
                ],
                "accept": [
                  "array",
                  [
                    [
                      "string",
                      "accept: application\/ld+json"
                    ]
                  ]
                ],
                "authorization": [
                  "array",
                  [
                    [
                      "string",
                      "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NjE2NDQ1NDMsImV4cCI6MTY2MjI0OTM0Mywicm9sZXMiOlsiUk9MRV9TVVBFUl9BRE1JTiJdLCJlbWFpbCI6IlJPTEVfU1VQRVJfQURNSU5OT1RfRFVNTVlAMS5jb20ifQ.I4-XsFpmOtXkVdEYqmVA9hcrYtvraw7nBk8gYfd-Lp94t0yY7qVkaYJHAvSUSd0W1XBqz5qiyft741b8hgaKHbCxvKmykW79z2fA1la0xE3sTuz8ED1rT0kya4JwPkbxikK0BPon5eqimtD8kf5GzZfqdtoetHRE4EmaR9cuY4myJnz0sYsl6OGZu81FUhlSsluFEcEuz29FTE8bU92UYxnzSUAbTsD6Xpwl95XQwK0De3I0mpW4pfl8u3KuSSvTYNIk9kTHV5j6C8N92sq_vuym-l4Njth8q0dRgwzK4eXAMqZOEhYZCwoT_WPgX9so5LaE4fwVjGXRgHR9gVuc6g"
                    ]
                  ]
                ]
              }
            ],
            "headers": [
              "array",
              [
                [
                  "string",
                  "Content-Type: application\/json"
                ],
                [
                  "string",
                  "accept: application\/ld+json"
                ],
                [
                  "string",
                  "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NjE2NDQ1NDMsImV4cCI6MTY2MjI0OTM0Mywicm9sZXMiOlsiUk9MRV9TVVBFUl9BRE1JTiJdLCJlbWFpbCI6IlJPTEVfU1VQRVJfQURNSU5OT1RfRFVNTVlAMS5jb20ifQ.I4-XsFpmOtXkVdEYqmVA9hcrYtvraw7nBk8gYfd-Lp94t0yY7qVkaYJHAvSUSd0W1XBqz5qiyft741b8hgaKHbCxvKmykW79z2fA1la0xE3sTuz8ED1rT0kya4JwPkbxikK0BPon5eqimtD8kf5GzZfqdtoetHRE4EmaR9cuY4myJnz0sYsl6OGZu81FUhlSsluFEcEuz29FTE8bU92UYxnzSUAbTsD6Xpwl95XQwK0De3I0mpW4pfl8u3KuSSvTYNIk9kTHV5j6C8N92sq_vuym-l4Njth8q0dRgwzK4eXAMqZOEhYZCwoT_WPgX9so5LaE4fwVjGXRgHR9gVuc6g"
                ]
              ]
            ],
            "query": [
              "array",
              []
            ],
            "base_uri": [
              "array",
              {
                "scheme": [
                  "string",
                  "http:"
                ],
                "authority": [
                  "string",
                  "\/\/caddy"
                ],
                "path": [
                  "null",
                  null
                ],
                "query": [
                  "null",
                  null
                ],
                "fragment": [
                  "null",
                  null
                ]
              }
            ],
            "body": [
              "string",
              ""
            ],
            "json": [
              "null",
              null
            ],
            "extra": [
              "array",
              []
            ],
            "http_version": [
              "null",
              null
            ],
            "timeout": [
              "float",
              60
            ],
            "max_duration": [
              "float",
              0
            ]
          }
        ]
      ]
    },
    {
      "namespace": "App\\Tests\\Api\\Voter\\Generated",
      "short_class": "UserVoterTest",
      "class": "App\\Tests\\Api\\Voter\\Generated\\UserVoterTest",
      "type": "-\u003E",
      "function": "testGetUsersWaiterEstablishmentsId_SUPER_ADMIN_NOT_DUMMY",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestCase.php",
      "line": 1545,
      "args": []
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestCase",
      "class": "PHPUnit\\Framework\\TestCase",
      "type": "-\u003E",
      "function": "runTest",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestCase.php",
      "line": 1151,
      "args": []
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestCase",
      "class": "PHPUnit\\Framework\\TestCase",
      "type": "-\u003E",
      "function": "runBare",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestResult.php",
      "line": 726,
      "args": []
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestResult",
      "class": "PHPUnit\\Framework\\TestResult",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestCase.php",
      "line": 903,
      "args": [
        [
          "object",
          "App\\Tests\\Api\\Voter\\Generated\\UserVoterTest"
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestCase",
      "class": "PHPUnit\\Framework\\TestCase",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestSuite.php",
      "line": 672,
      "args": [
        [
          "object",
          "PHPUnit\\Framework\\TestResult"
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestSuite",
      "class": "PHPUnit\\Framework\\TestSuite",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestSuite.php",
      "line": 672,
      "args": [
        [
          "object",
          "PHPUnit\\Framework\\TestResult"
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestSuite",
      "class": "PHPUnit\\Framework\\TestSuite",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/Framework\/TestSuite.php",
      "line": 672,
      "args": [
        [
          "object",
          "PHPUnit\\Framework\\TestResult"
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\Framework",
      "short_class": "TestSuite",
      "class": "PHPUnit\\Framework\\TestSuite",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/TextUI\/TestRunner.php",
      "line": 673,
      "args": [
        [
          "object",
          "PHPUnit\\Framework\\TestResult"
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\TextUI",
      "short_class": "TestRunner",
      "class": "PHPUnit\\TextUI\\TestRunner",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/TextUI\/Command.php",
      "line": 143,
      "args": [
        [
          "object",
          "PHPUnit\\Framework\\TestSuite"
        ],
        [
          "array",
          {
            "extensions": [
              "array",
              []
            ],
            "listGroups": [
              "boolean",
              false
            ],
            "listSuites": [
              "boolean",
              false
            ],
            "listTests": [
              "boolean",
              false
            ],
            "listTestsXml": [
              "boolean",
              false
            ],
            "loader": [
              "null",
              null
            ],
            "useDefaultConfiguration": [
              "boolean",
              true
            ],
            "loadedExtensions": [
              "array",
              []
            ],
            "unavailableExtensions": [
              "array",
              []
            ],
            "notLoadedExtensions": [
              "array",
              []
            ],
            "filter": [
              "string",
              "testGetUsersWaiterEstablishmentsId_SUPER_ADMIN_NOT_DUMMY"
            ],
            "testSuffixes": [
              "array",
              [
                [
                  "string",
                  "Test.php"
                ],
                [
                  "string",
                  ".phpt"
                ]
              ]
            ],
            "configuration": [
              "string",
              "\/srv\/api\/phpunit.xml.dist"
            ],
            "configurationObject": [
              "object",
              "PHPUnit\\TextUI\\XmlConfiguration\\Configuration"
            ],
            "stderr": [
              "boolean",
              false
            ],
            "columns": [
              "integer",
              80
            ],
            "warnings": [
              "array",
              []
            ],
            "debug": [
              "boolean",
              false
            ],
            "listeners": [
              "array",
              [
                [
                  "object",
                  "Symfony\\Bridge\\PhpUnit\\Legacy\\SymfonyTestsListenerForV7"
                ]
              ]
            ],
            "backupGlobals": [
              "boolean",
              false
            ],
            "backupStaticAttributes": [
              "boolean",
              false
            ],
            "beStrictAboutChangesToGlobalState": [
              "boolean",
              false
            ],
            "cacheResult": [
              "boolean",
              true
            ],
            "colors": [
              "string",
              "auto"
            ],
            "convertDeprecationsToExceptions": [
              "boolean",
              false
            ],
            "convertErrorsToExceptions": [
              "boolean",
              true
            ],
            "convertNoticesToExceptions": [
              "boolean",
              true
            ],
            "convertWarningsToExceptions": [
              "boolean",
              true
            ],
            "processIsolation": [
              "boolean",
              false
            ],
            "stopOnDefect": [
              "boolean",
              false
            ],
            "stopOnError": [
              "boolean",
              false
            ],
            "stopOnFailure": [
              "boolean",
              false
            ],
            "stopOnWarning": [
              "boolean",
              false
            ],
            "stopOnIncomplete": [
              "boolean",
              false
            ],
            "stopOnRisky": [
              "boolean",
              false
            ],
            "stopOnSkipped": [
              "boolean",
              false
            ],
            "failOnEmptyTestSuite": [
              "boolean",
              false
            ],
            "failOnIncomplete": [
              "boolean",
              false
            ],
            "failOnRisky": [
              "boolean",
              false
            ],
            "failOnSkipped": [
              "boolean",
              false
            ],
            "failOnWarning": [
              "boolean",
              false
            ],
            "enforceTimeLimit": [
              "boolean",
              false
            ],
            "defaultTimeLimit": [
              "integer",
              1
            ],
            "timeoutForSmallTests": [
              "integer",
              1
            ],
            "timeoutForMediumTests": [
              "integer",
              10
            ],
            "timeoutForLargeTests": [
              "integer",
              60
            ],
            "reportUselessTests": [
              "boolean",
              true
            ],
            "strictCoverage": [
              "boolean",
              false
            ],
            "ignoreDeprecatedCodeUnitsFromCodeCoverage": [
              "boolean",
              false
            ],
            "disallowTestOutput": [
              "boolean",
              false
            ],
            "disallowTodoAnnotatedTests": [
              "boolean",
              false
            ],
            "beStrictAboutResourceUsageDuringSmallTests": [
              "boolean",
              false
            ],
            "verbose": [
              "boolean",
              false
            ],
            "reverseDefectList": [
              "boolean",
              false
            ],
            "forceCoversAnnotation": [
              "boolean",
              false
            ],
            "disableCodeCoverageIgnore": [
              "boolean",
              false
            ],
            "registerMockObjectsFromTestArgumentsRecursively": [
              "boolean",
              false
            ],
            "noInteraction": [
              "boolean",
              false
            ],
            "executionOrder": [
              "integer",
              0
            ],
            "resolveDependencies": [
              "boolean",
              true
            ],
            "bootstrap": [
              "string",
              "\/srv\/api\/tests\/bootstrap.php"
            ],
            "executionOrderDefects": [
              "integer",
              0
            ],
            "crap4jThreshold": [
              "integer",
              30
            ],
            "excludeGroups": [
              "array",
              []
            ],
            "groups": [
              "array",
              []
            ],
            "randomOrderSeed": [
              "integer",
              1661644770
            ],
            "repeat": [
              "boolean",
              false
            ],
            "reportHighLowerBound": [
              "integer",
              90
            ],
            "reportLowUpperBound": [
              "integer",
              50
            ],
            "reverseList": [
              "boolean",
              false
            ],
            "testdoxExcludeGroups": [
              "array",
              []
            ],
            "testdoxGroups": [
              "array",
              []
            ],
            "cacheResultFile": [
              "string",
              "\/srv\/api"
            ]
          }
        ],
        [
          "array",
          []
        ],
        [
          "boolean",
          true
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\TextUI",
      "short_class": "Command",
      "class": "PHPUnit\\TextUI\\Command",
      "type": "-\u003E",
      "function": "run",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/src\/TextUI\/Command.php",
      "line": 96,
      "args": [
        [
          "array",
          [
            [
              "string",
              "vendor\/bin\/phpunit"
            ],
            [
              "string",
              "--filter"
            ],
            [
              "string",
              "testGetUsersWaiterEstablishmentsId_SUPER_ADMIN_NOT_DUMMY"
            ]
          ]
        ],
        [
          "boolean",
          true
        ]
      ]
    },
    {
      "namespace": "PHPUnit\\TextUI",
      "short_class": "Command",
      "class": "PHPUnit\\TextUI\\Command",
      "type": "::",
      "function": "main",
      "file": "\/srv\/api\/vendor\/phpunit\/phpunit\/phpunit",
      "line": 98,
      "args": []
    },
    {
      "namespace": "",
      "short_class": "",
      "class": "",
      "type": "",
      "function": "include",
      "file": "\/srv\/api\/vendor\/bin\/phpunit",
      "line": 120,
      "args": [
        [
          "string",
          "\/srv\/api\/vendor\/phpunit\/phpunit\/phpunit"
        ]
      ]
    }
  ]
}
@Ocramius
Copy link
Sponsor Collaborator

Please read the release notes: https://github.com/lcobucci/jwt/releases/tag/4.2.0

@Ocramius Ocramius self-assigned this Aug 28, 2022
@Lenny4
Copy link
Author

Lenny4 commented Aug 28, 2022

@Ocramius
In the release note it's written

To contain the impact of the changes and give time for people to rotate keys, we have deprecated implementations that maintain the previous behaviour and allow unsafe keys.

But it seems to not be the case as I got an error and not a deprecation.

@lcobucci
Copy link
Owner

@Lenny4 deprecated classes were introduced to allow that (like UnsafeSha256).

Check the "for more information" link, mentioned right after the sentence you pasted here 👍

@Lenny4
Copy link
Author

Lenny4 commented Aug 28, 2022

@lcobucci

Yes I saw that too but still it's a breaking change as code working well on 4.1 doesn't on 4.2. So there is a breaking change while major version didn't change.

@Ocramius
Copy link
Sponsor Collaborator

Yes, that is intentional: #877 (comment)

@nikalemdzievski
Copy link

nikalemdzievski commented Sep 29, 2022

Minor breaking change? Seriosly?
Minor or major, breaking change is a breaking change. You should have introduced this in a major version.

@Ocramius
Copy link
Sponsor Collaborator

Ocramius commented Sep 29, 2022

Security eats stability for breakfast.

Locking here.

Repository owner locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants