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

Allow plugins to add/modify API endpoints of existing entity #9434

Closed
touhidurabir opened this issue Oct 20, 2023 · 8 comments
Closed

Allow plugins to add/modify API endpoints of existing entity #9434

touhidurabir opened this issue Oct 20, 2023 · 8 comments
Assignees
Labels
Enhancement:2:Moderate A new feature or improvement that can be implemented in less than 4 weeks. Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Milestone

Comments

@touhidurabir
Copy link
Member

touhidurabir commented Oct 20, 2023

Describe the problem
With the merge of #7698 in the main branch(Future 3.5.0 LTS) , slim routing toolset set has been removed as one of the core dependency and the API implementation moved to laravel routing toolset completely . This has made the previously applied hook APIHandler::endpoints to tap into and modify/add/update obsolete and removed .

Describe the proposal
Possible enhancement is to bring back the hook similar kind of hook APIHandler::endpoints to allow dynamic insertion of API routes on run time using laravel router which oversees the each routing process . This will be helpful for plugins to inject routes to any existing routes collection .

What application are you using?
OJS, OMP or OPS version main

PRs
pkp-lib --> #9451
ojs --> pkp/ojs#4081 [TEST ONLY]
omp --> pkp/omp#1625 [TEST ONLY]
ops --> pkp/ops#724 [TEST ONLY]

An example plugin to demonstrate the usage of plugin level api implementation at https://github.com/touhidurabir/apiExample

Additional Information
Feature request : https://forum.pkp.sfu.ca/t/create-custom-api-handler-ver-3-5/89101/4

@touhidurabir touhidurabir self-assigned this Oct 23, 2023
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Oct 23, 2023
@touhidurabir
Copy link
Member Author

@asmecher can you please preview the PR at #9434 (comment)

@touhidurabir touhidurabir added the Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. label Oct 23, 2023
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Oct 23, 2023
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Oct 23, 2023
@asmecher
Copy link
Member

asmecher commented Nov 9, 2023

Thanks, @touhidurabir! I added a review: #9451 (review)

touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 21, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 21, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 21, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jun 21, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jun 21, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jun 23, 2024
touhidurabir added a commit to touhidurabir/apiExample that referenced this issue Jun 23, 2024
@touhidurabir
Copy link
Member Author

@asmecher can you take a look at the PRs at #9434 (comment)

@touhidurabir touhidurabir added this to the 3.5.0 LTS milestone Jun 24, 2024
@touhidurabir touhidurabir removed the Enhancement:1:Minor A new feature or improvement that can be implemented in less than 3 days. label Jun 24, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/omp that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/omp that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/ops that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/ops that referenced this issue Jul 9, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/ojs that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/omp that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/omp that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/ops that referenced this issue Jul 26, 2024
touhidurabir added a commit to touhidurabir/ops that referenced this issue Jul 26, 2024
@touhidurabir
Copy link
Member Author

@asmecher All tests have passed so should be good to merge .

asmecher pushed a commit that referenced this issue Jul 29, 2024
* #9434 Allow plugin level API call

* #9434 Updated hook call and fixed handler related bug

* #9434 removed misplaced reference of old SessionManager

* #9434 added ability to generate routes via closure and plugin level api url

* #9434 removed plugin level api ability

* #9434 typo and retuen type fixed

* #9434 minor fixes and removed unused translation

* #9434 replaced PKPContainder::getInstance() with app()
@asmecher
Copy link
Member

Merged for main, thanks, @touhidurabir! But do you think this is worth back-porting to stable-3_4_0 too?

@touhidurabir
Copy link
Member Author

But do you think this is worth back-porting to stable-3_4_0 too?

@asmecher we don't need to back port it to stable3-4-0 as it use the Slim for api routing purpose . And stable-3.4.0 has it's own hook to allow plugin to add api routes .

@touhidurabir
Copy link
Member Author

Closing this as this does not need back porting .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:2:Moderate A new feature or improvement that can be implemented in less than 4 weeks. Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Projects
None yet
Development

No branches or pull requests

2 participants