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

Deprecate AbstractApi::get() #381

Conversation

Art4
Copy link
Collaborator

@Art4 Art4 commented Feb 14, 2024

AbstractApi::get() does not allow to specify the content type header for the request and could return string|array|SimpleXMLElement|false. In this PR I moved the logic from this method into the API classes. There we can better see the possible return types and I've updated the phpdoc return types accordingly.

Thanks to new and improved tests I could also fix a bug in Redmine\Api\Attachment::download() returning false on error instead of the HTML 404 error page.

This PR removes the @internal mark from the new HttpClient and Request interfaces and deprecates AbstractApi::get().

I will do the same for AbstractApi::post(), AbstractApi::put() and AbstractApi::delete() in separate PRs, see #372.

Requires #378.

@Art4 Art4 added this to the v2.6.0 milestone Feb 14, 2024
@Art4 Art4 self-assigned this Feb 14, 2024
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (81259f3) 97.63% compared to head (2f6b3d7) 97.71%.

Additional details and impacted files
@@             Coverage Diff              @@
##               v2.x     #381      +/-   ##
============================================
+ Coverage     97.63%   97.71%   +0.07%     
- Complexity      563      589      +26     
============================================
  Files            29       29              
  Lines          1609     1707      +98     
============================================
+ Hits           1571     1668      +97     
- Misses           38       39       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

gitguardian bot commented Feb 14, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9556153 Triggered Generic High Entropy Secret 97b80d9 tests/Behat/features/wiki.feature View secret
9556153 Triggered Generic High Entropy Secret 97b80d9 tests/Behat/features/wiki.feature View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@Art4 Art4 changed the title Deprecate AbstractApi::get(), AbstractApi::post(), AbstractApi::put() and AbstractApi::delete() Deprecate AbstractApi::get() Feb 14, 2024
@Art4 Art4 marked this pull request as ready for review February 16, 2024 13:58
@Art4 Art4 requested a review from kbsali February 16, 2024 13:58
@Art4 Art4 merged commit 3f6474f into v2.x Feb 22, 2024
21 checks passed
@Art4 Art4 deleted the 372-deprecate-abstractapiget-abstractapipost-abstractapiput-and-abstractapidelete branch February 22, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant