-
Notifications
You must be signed in to change notification settings - Fork 10
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
Webfinger #2
Comments
Yup, I think WebFinger definitely belongs in the library since it's a de-facto standard for AP discovery. I'm still up in the air about what the API should look like. It could be built into the existing if ( $activitypub->shouldHandle() ) {
$response = $activitypub->handle();
$response->send();
} Or the library could expose a method The first approach is definitely easier for callers, but it's not very flexible - it locks library users into WebFinger, and it doesn't provide a way for users to customize the WebFinger responses at all (although that could be mitigated by allowing a custom WebFinger function in the config). The second approach is a lot more flexible, but it requires users to explicitly opt into WebFinger and to manually decide when a request is a WebFinger request. @squeevee, what do you think? |
I'm rather in favor of the second option. I think it's cleaner to separate WebFinger objects from ActivityPub ones. From a calling perspective, it's very logical, even if a little more verbose, if WebFinger requests can only ever be sent to the URL /.well-known/webfinger (https://tools.ietf.org/html/rfc7033#section-4) so it's trivial to tell it apart from other requests. |
Cool, the second option makes sense to me as well. I'm still in the middle of implementing the core ActivityPub pipeline, but when I get to WebFinger I'll implement as a separate part of the API. |
I've tossed something together (it seemed like low-hanging fruit) This expects the caller to be able to "canonize" the username from the form Wondering what you think before I make a PR |
Yeah, I like this approach. You'll add an Also, I'm not sure Nit: could you use |
Will do all that. If we're delegating to the caller to canonize usernames, then it might also make sense to have the caller responsible for validating / checking for the existence of usernames. In which case, the json builder could be a static function (maybe in the Utils namespace). If it's static that wouldn't work with the callable being set to an ActivityPubConfig field but food for thought? It's difficult for me to anticipate any more WebFinger functionality being necessary unless at some point in the future this library takes charge of canonizing usernames. |
I think it would make sense for the JSON builder to at least check for the existence of the canonical actor in the database (as it does in the current iteration of your code), which would mean it couldn't be static. I do agree that we probably won't need much more WebFinger functionality beyond this though. |
Is there any intent to support Webfinger with this library, since Mastodon uses it? Or is the library strictly ActivityPub-as-advertised?
The text was updated successfully, but these errors were encountered: