Skip to content

Remove Authentication\Owner_ID #11727

@aaemnnosttv

Description

@aaemnnosttv

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_ID class and all its usage should be removed

Implementation Brief

  • Delete the unused global owner abstraction:
    • Remove includes/Core/Authentication/Owner_ID.php entirely.
    • In includes/Core/Authentication/Authentication.php, strip the $owner_id property, its instantiation in the constructor, and the get_owner_id_instance() helper.
    • In includes/Core/Authentication/REST_Authentication_Controller.php, stop returning ownerID from the /core/site/data/connection response so the payload reflects the simplified state.
  • Update OAuth handling to no longer track a global owner:
    • In includes/Core/Authentication/Clients/OAuth_Client.php, remove the use Owner_ID import, the $owner_id member, the instantiation in the constructor, the call that sets the owner after authorization, and the private should_update_owner_id() method.
    • Drop the corresponding PHPUnit coverage—remove tests/phpunit/integration/Core/Authentication/Owner_IDTest.php and the should_update_owner_id logic/assertions in tests/phpunit/integration/Core/Authentication/Clients/OAuth_ClientTest.php.
  • Adjust JS consumers of the connection endpoint:
    • In assets/js/googlesitekit/datastore/site/connection.js, remove the ownerID field 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 referencing ownerID) to match the new response shape.
  • Remove any lingering references to the global owner option (googlesitekit_owner_id) across PHP/JS (search for Owner_ID/ownerID touching the connection data) to prevent dead code.

Test Coverage

  • PHP: delete the Owner_ID tests 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

No one assigned

    Labels

    P1Medium priorityPHPType: EnhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions