-
Notifications
You must be signed in to change notification settings - Fork 83
Store and retrieve webfinger acct for remote actors #2575
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
Conversation
Add storage and retrieval of webfinger acct (_activitypub_acct) for remote actors to improve actor identification and reduce webfinger lookups. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replaces the variable name 'acct' with 'webfinger' for clarity and consistency when handling actor webfinger accounts in Remote_Actors. No functional changes were made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds persistence and retrieval of webfinger account identifiers for remote ActivityPub actors to optimize lookups and improve actor identification.
- Store webfinger acct in post meta when creating/updating remote actors
- Retrieve and populate webfinger from stored meta or generate it when loading actors
- Add fallback generation logic when webfinger is not available
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| includes/collection/class-remote-actors.php | Adds webfinger storage in _activitypub_acct meta field and retrieval logic with fallback generation |
| .github/changelog/2575-from-description | Adds changelog entry documenting the webfinger storage feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add comprehensive test coverage for: - Storing webfinger acct when creating actors - Populating webfinger when loading actors from database - Generating webfinger from actor URL when not available - Updating webfinger acct when actor is updated - Using webfinger from actor object when provided
Update Webfinger::guess fallback to use object_to_uri with a null coalescing check on actor URL or ID. This ensures a valid URI is always passed, preventing errors when actor URLs are missing.
Update calls to Webfinger::guess to pass the actor object directly instead of converting to URI. This simplifies the code and ensures consistent handling of actor data.
2888778 to
597a8ca
Compare
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/includes/collection/class-test-remote-actors.php
Outdated
Show resolved
Hide resolved
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
…rs.php Co-authored-by: Konstantin Obenland <obenland@gmx.de>
Refines the logic for setting the webfinger property on remote actors. Now attempts to retrieve the value from post meta, falls back to URI conversion, and uses a guessing method if necessary, ensuring the value is sanitized before assignment.
Simplifies the acct property assignment by using $actor->get_webfinger() instead of converting the actor ID with Webfinger_Util::uri_to_acct. Removes unnecessary string manipulation and error checking.
Proposed changes:
_activitypub_acctpost meta when creating/updating remote actorsOther information:
Testing instructions:
_activitypub_acctpost meta is stored with the webfinger address./vendor/bin/phpunit tests/phpunit/tests/includes/collection/class-test-remote-actors.phpChangelog entry
Changelog Entry Details
Significance
Type
Message
Store and retrieve webfinger acct for remote actors to improve identification and reduce lookups