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

Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found #2213

Open
daniilly opened this issue Mar 2, 2023 · 1 comment
Open

Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found #2213

daniilly opened this issue Mar 2, 2023 · 1 comment

Comments

@daniilly
Copy link

daniilly commented Mar 2, 2023

Subject of the issue

An attempt to create an instance of the Tymon\JWTAuth\Providers\JWT\Namshi class using the AbstractServiceProvider::registerNamshiProvider() method failed because the class does not exist anymore, as it was dropped in a recent commit: b0868a5#diff-f6d0165250945a702d3edc292ddd71188eaadef24c305ad994ae7c6e50fb7664

Your environment

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 9.49.0
Package version 2.0.0
PHP version 8.1.11

Steps to reproduce

We have code that calls Manager::encode:

...
/** @type Token $token */
$token = JWTAuth::manager()->encode($payload);
...

Following that, at a certain stage in the call chain, there is a call to AbstractServiceProvider::getConfigInstance("providers.jwt"), which subsequently triggers the resolution of AbstractServiceProvider::registerNamshiProvider(). As a result, an attempt is made to instantiate the removed class.

Expected behavior

To get encoded Token

Actual behaviour

Error: Class "Tymon\JWTAuth\Providers\JWT\Namshi" not found

daniilly added a commit to dreamfactorysoftware/df-core that referenced this issue Mar 2, 2023
Resolve conflict with `db.schema` component. App code used `db.schema`
name for `DbSchemaExtensions` component. Starting from Laravel 9 this
name is used internally because of migration to string based accessor
for Schema facade laravel/framework@8059b39.
The cure is to use `df` prefix for app `db.schema` component.

Fix single quotes encode in error message. In PHP 8 default string
escape strategy changed to escape single quotes (') as well. This commit
adds explicit use of `ENT_COMPAT` flag.
See https://www.php.net/manual/en/function.htmlentities.php

Get rid of request dynamic properties retrieving.
`request->wrap` dynamic property was leading to full request params
reload including file uploads. Uploaded file was moved and not available
that caused an error. Instead we explicitly read query param by name.

Resolve deprecated required parameter after optional one.
See https://php.watch/versions/8.0/deprecate-required-param-after-optional

Fix db migration using SQLite. Connection config must hold `name`
property since Laravel 8.83.2. See laravel/framework@03e3a807.

Use 30 sec timeout for cURL requests. Misconfigured TCP logger was
leading to system hang up because of endless waiting for response.
Now requests will fail after 30 seconds of waiting.

We could switch to v2.0 of tymon/jwt-auth package when this issue got resolved:
tymondesigns/jwt-auth#2213

Other changes:
- Update dependencies
- Upgrade CORS middleware
- Fix unit tests
daniilly added a commit to dreamfactorysoftware/df-core that referenced this issue Mar 3, 2023
Resolve conflict with `db.schema` component. App code used `db.schema`
name for `DbSchemaExtensions` component. Starting from Laravel 9 this
name is used internally because of migration to string based accessor
for Schema facade laravel/framework@8059b39.
The cure is to use `df` prefix for app `db.schema` component.

Fix single quotes encode in error message. In PHP 8 default string
escape strategy changed to escape single quotes (') as well. This commit
adds explicit use of `ENT_COMPAT` flag.
See https://www.php.net/manual/en/function.htmlentities.php

Get rid of request dynamic properties retrieving.
`request->wrap` dynamic property was leading to full request params
reload including file uploads. Uploaded file was moved and not available
that caused an error. Instead we explicitly read query param by name.

Resolve deprecated required parameter after optional one.
See https://php.watch/versions/8.0/deprecate-required-param-after-optional

Fix db migration using SQLite. Connection config must hold `name`
property since Laravel 8.83.2. See laravel/framework@03e3a807.

Use 30 sec timeout for cURL requests. Misconfigured TCP logger was
leading to system hang up because of endless waiting for response.
Now requests will fail after 30 seconds of waiting.

We could switch to v2.0 of tymon/jwt-auth package when this issue got resolved:
tymondesigns/jwt-auth#2213

Other changes:
- Update dependencies
- Upgrade CORS middleware
- Fix unit tests
@ABouchard55
Copy link

From what I found, it was changed (back, I think) to Lcobucci because Namshi is deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants