-
Notifications
You must be signed in to change notification settings - Fork 326
Open
Labels
P1Medium priorityMedium priorityPHPType: EnhancementImprovement of an existing featureImprovement of an existing feature
Description
Feature Description
In #1743 we introduced the Owner_ID class as part of a larger initiative to introduce the concept of ownership for individual modules and the site as a whole. While ownership at the module level has gone on to form the basis of dashboard sharing, ownership at the "global" SK level has never been used.
As we found with ownership at the module level, it can get rather complicated, and for the time being, it seems that this level of ownership is sufficient.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
Core\Authentication\Owner_IDclass and all its usage should be removed
Implementation Brief
- Delete the unused global owner abstraction:
- Remove
includes/Core/Authentication/Owner_ID.phpentirely. - In
includes/Core/Authentication/Authentication.php, strip the$owner_idproperty, its instantiation in the constructor, and theget_owner_id_instance()helper. - In
includes/Core/Authentication/REST_Authentication_Controller.php, stop returningownerIDfrom the/core/site/data/connectionresponse so the payload reflects the simplified state.
- Remove
- Update OAuth handling to no longer track a global owner:
- In
includes/Core/Authentication/Clients/OAuth_Client.php, remove theuse Owner_IDimport, the$owner_idmember, the instantiation in the constructor, the call that sets the owner after authorization, and the privateshould_update_owner_id()method. - Drop the corresponding PHPUnit coverage—remove
tests/phpunit/integration/Core/Authentication/Owner_IDTest.phpand theshould_update_owner_idlogic/assertions intests/phpunit/integration/Core/Authentication/Clients/OAuth_ClientTest.php.
- In
- Adjust JS consumers of the connection endpoint:
- In
assets/js/googlesitekit/datastore/site/connection.js, remove theownerIDfield from the store state, selectors (e.g.getOwnerID), and any related derivations. - Update
assets/js/googlesitekit/datastore/site/connection.test.js(and any other tests referencingownerID) to match the new response shape.
- In
- Remove any lingering references to the global owner option (
googlesitekit_owner_id) across PHP/JS (search forOwner_ID/ownerIDtouching the connection data) to prevent dead code.
Test Coverage
- PHP: delete the
Owner_IDtests and update affected OAuth client tests so the suite passes without the global owner logic. - JS: update the connection store Jest tests to reflect the trimmed state shape.
QA Brief
Changelog entry
Metadata
Metadata
Assignees
Labels
P1Medium priorityMedium priorityPHPType: EnhancementImprovement of an existing featureImprovement of an existing feature