Skip to content

feat(plugins): Better define plugin behaviour protocols#1514

Merged
dpogue merged 3 commits intoapache:masterfrom
dpogue:plugin-protocols
Jan 15, 2025
Merged

feat(plugins): Better define plugin behaviour protocols#1514
dpogue merged 3 commits intoapache:masterfrom
dpogue:plugin-protocols

Conversation

@dpogue
Copy link
Copy Markdown
Member

@dpogue dpogue commented Dec 14, 2024

Platforms affected

iOS

Motivation and Context

Closes GH-1212.
Closes GH-1272.
Closes GH-1333.

Description

Adds protocols to formalize the methods that plugins should implement to interact with behaviour around authentication challenges and navigation decisions.

For navigation decisions, we now pass along the full navigation action details as a dictionary.

This also adds the ability for plugins to intercept and respond to server authentication challenges.

Testing

All existing tests pass.

Checklist

  • I've run the tests to see all new and existing tests pass
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@dpogue dpogue added this to the 8.0.0 milestone Dec 14, 2024
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 14, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.34%. Comparing base (d2db6e6) to head (2da37a6).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1514   +/-   ##
=======================================
  Coverage   81.34%   81.34%           
=======================================
  Files          16       16           
  Lines        1855     1855           
=======================================
  Hits         1509     1509           
  Misses        346      346           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpogue dpogue force-pushed the plugin-protocols branch 2 times, most recently from 81ea6a4 to 778b874 Compare December 17, 2024 22:10
dpogue and others added 3 commits December 26, 2024 23:02
Closes apacheGH-1212.

Co-Authored-By: Christopher J. Brody <chris.brody+brodybits@gmail.com>
This also adds a dictionary parameter containing the other navigation
action details so that plugins can make choices based on frames.

Closes apacheGH-1272.
Closes apacheGH-1333.

Co-Authored-By: Michael Tamburro <61243400+msmtamburro@users.noreply.github.com>
without a credential.
- Returns: A Boolean value indicating if the plugin is handling the request.
*/
- (BOOL)willHandleAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erisu Updated this to be willHandleAuthenticationChallenge and return a BOOL so that multiple plugins can have a chance to respond

Copy link
Copy Markdown
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dpogue dpogue merged commit 82c1767 into apache:master Jan 15, 2025
@dpogue dpogue deleted the plugin-protocols branch January 15, 2025 05:35
OS-kepatotorica pushed a commit to OutSystems/cordova-ios that referenced this pull request Aug 14, 2025
* feat(plugins): Add plugin support for auth challenge responses

Closes apacheGH-1212.

Co-Authored-By: Christopher J. Brody <chris.brody+brodybits@gmail.com>

* refactor(plugins): Add CDVPluginNavigationHandler protocol

This also adds a dictionary parameter containing the other navigation
action details so that plugins can make choices based on frames.

Closes apacheGH-1272.
Closes apacheGH-1333.

Co-Authored-By: Michael Tamburro <61243400+msmtamburro@users.noreply.github.com>

* fix(scrollview): Add nullable attribute to scrollView property

---------

Co-authored-by: Christopher J. Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Michael Tamburro <61243400+msmtamburro@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants