-
Notifications
You must be signed in to change notification settings - Fork 32
Laravel 8 support, Jira v3 API compatibility, Fix paginate request with query params, Fix naming collision with jwt-auth. #16
base: master
Are you sure you want to change the base?
Conversation
|
||
protected function serializeDate(DateTimeInterface $date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default date serialization format was changed in Laravel 7. See here: https://laravel.com/docs/7.x/upgrade#date-serialization
src/Http/routes.php
Outdated
@@ -6,11 +6,11 @@ | |||
Route::post('installed', 'TenantController@installed')->name('installed'); | |||
Route::post('disabled', 'TenantController@disabled')->name('disabled'); | |||
|
|||
Route::group(['middleware' => 'jwt'], function () { | |||
Route::group(['middleware' => 'auth.atlassian'], function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a collision for you? We could rename it like this, but I want to understand whether this is a real issue.
Furthermore, we need to update README, so users will define this middleware instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed a simpler solution for this by directly referencing the class. See commit 942c6cf
src/ServiceProvider.php
Outdated
@@ -127,7 +127,7 @@ protected function registerFacades() | |||
*/ | |||
protected function registerJWTGuard() | |||
{ | |||
Auth::extend('jwt', function (Application $app, $name, array $config) | |||
Auth::extend('jwt.atlassian', function (Application $app, $name, array $config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you experience a collision in a real project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, yes i have a project where i use tymondesigns/jwt-auth which also names it's guard "jwt". I have updated the pull-request to make this configurable: 942c6cf
@henritoivar thanks for the contribution. If we add support for v3 API, v2 won't be longer supported. Would that be an issue? I'll also add support for L7 in this PR since there is not a lot of changes between those. |
…n header. This is causing the requests to redirect instead of returning json in case the validation does not pass.
… Atlassian Account ID from the sub property of the JWT claim instead.
…ame tag. Directly reference middleware so user doesn't have to use exact alias in vendor file.
I have added a few more adjustments:
|
I use only v3, so it's not a problem for me. |
…same query then the second request returns data from the previous request.
Are there any plans to integrate that PR into master? It would be pretty nice, cause i have laravel 8 project which would benefit from that :-) |
@henritoivar Is it possible/reasonable for me to manually merge this pull request locally so i can use this in Laravel 8, is it stable enough in your opinion? |
@mystiquewolf I'm using this in production myself. So far no issues. Until this gets merged you could use my fork (or fork my fork.. hehe) directly like this in your composer.json:
|
Also validate requests that are coming from Atlassian. We need to strip our base url to properly calculate QSH. See here: https://developer.atlassian.com/cloud/bitbucket/query-string-hash/ Actually validate JWT from requests sent by Atlassian. Also validate QSH for these requests.
Sorry guys for abandoning this repo, I can't manage to find time to maintain and improve this package. I'm happy to invite someone as a collaborator on this project, making sure every change gets tested and follows the project coding style. Please send an email to [email protected] if you're interested. |
Updated dependencies to support Laravel 8.
Updated Jira Paginator to use v3 API conventions.
Fixed query parameters being overwritten by default pagination parameters, when providing query parameters to $client->paginate.
Made guard name and middleware name more specific to avoid naming collision with tymon/jwt-auth. Ideally thiese two could be defined in the config?