Make WordPress Core

Opened 5 months ago

Last modified 4 weeks ago

#64850 assigned enhancement

Connectors: Extend bridge for JS custom card rendering and non-API-key authentication support

Reported by: gziolo Owned by: jorgefilipecosta
Priority: normal Milestone: Future Release
Component: Administration Version:
Severity: normal Keywords: connectors has-patch has-unit-tests
Cc: Focuses: javascript

Description

Follow-up to #64791, which completed the PHP side of the Connectors extensibility API (WP_Connector_Registry, wp_connectors_init action, wp_get_connectors() and related read functions). The remaining work is on improving integration with the JS side.

Every connector currently renders the same default card (API key input + save/remove). Plugins that need custom UI — OAuth flows, token status, multi-field forms — have no supported path. An experimental JS API is available to register a custom card renderer keyed to a connector ID.

Additionally, the PHP registry accepts any authentication.method, but the Connectors screen JS currently renders nothing for non-api_key connectors. These should surface at minimum as a generic card with a credentials_url link, or a custom renderer if the plugin provides one via item 1. This should cover methods such as OAuth, app passwords, and bearer tokens.

References

Change History (10)

#1 @gziolo
5 months ago

  • Summary Connectors: Add JS extensibility API for custom card rendering and non-API-key authentication supportConnectors: Extend bridge for JS custom card rendering and non-API-key authentication support

#2 @audrasjb
3 months ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

#3 @desrosj
3 months ago

  • Version trunk

Since this is an enhancement, there's no first version of WordPress this can be reproduced in. Removing trunk version.

#4 @JeffPaul
3 months ago

  • Keywords connectors added

#5 @JeffPaul
3 months ago

Noting that https://github.com/WordPress/gutenberg/issues/78647 is similar to what's called out here.

This ticket was mentioned in PR #12264 on WordPress/wordpress-develop by @jorgefilipecosta.


7 weeks ago
#6

  • Keywords has-patch has-unit-tests added

[In progress]

Adds an application_password connector authentication method with generated username/password settings, REST masking, script-module metadata, and unit coverage. Follow-up commits will complete cross-repository browser verification.

Trac: https://core.trac.wordpress.org/ticket/64850

@jorgefilipecosta commented on PR #12264:


5 weeks ago
#7

@gziolo following your feedback this now uses a single option with an object.

@gziolo commented on PR #12264:


5 weeks ago
#8

Overall, this is looking good. It has an extensive testing code coverage. It has the same changes as in the PR against the Gutenberg plugin, so the same feedback I shared there needs to be assessed:

https://github.com/WordPress/gutenberg/pull/79403#pullrequestreview-4652978587

#9 @jorgefilipecosta
5 weeks ago

In 62684:

Connectors: Add application password authentication.

Introduce an application_password connector authentication method. Registering a connector with this method auto-generates and registers a setting named connectors_{$type}_{$id}_application_password that stores the username and application password together as an object through the Settings API.
Only the application password is masked in REST responses; non-secret connection metadata is exposed to the admin UI via the connector script module data. Credentials may also be supplied through constants or environment variables, and malformed external values are reported with _doing_it_wrong() and skipped so resolution falls through to the next source.

Props jorgefilipecosta, gziolo, jorbin.
See #64850.

#10 @gziolo
4 weeks ago

  • Owner set to jorgefilipecosta
  • Status newassigned

@wildworks, there was a commit in this release cycle that adds support for application passwords. My understanding is that we should reflect that by marking this ticket as targeting 7.1 milestone and closing it, then opening a follow-up for the rest of the work if still necessary. Let us know how to proceed here.

Note: See TracTickets for help on using tickets.