-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
ability to add some entries out of rfc7033 #26178
Conversation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@@ -121,7 +121,8 @@ public function addProperty(string $property, ?string $value): self { | |||
* @param string|null $type https://tools.ietf.org/html/rfc7033#section-4.4.4.2 | |||
* @param string|null $href https://tools.ietf.org/html/rfc7033#section-4.4.4.3 | |||
* @param string[]|null $titles https://tools.ietf.org/html/rfc7033#section-4.4.4.4 | |||
* @param string|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5 | |||
* @param string[]|null $properties https://tools.ietf.org/html/rfc7033#section-4.4.4.5 | |||
* @param string[] $entries |
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.
so what is this? can you link to any docs?
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.
That is the problem, it's not in the official RFC ...
When you navigate on a remote instance of mastodon, and wants to follow an account from that instance, there is a 'Follow' button.
- Clicking on that button will open a popup that ask for your current fediverse account. Let's say my account is
maxence@test.nextcloud.com
. - The remote instance will request
https://test.nextcloud.com/.well-known/webfinger?resource=acct:maxence@test.nextcloud.com
to obtain the template of an URI (based on OStatus). This should be the result:
{
"subject": "acct:maxence@test.nextcloud.com",
"links": [
{
"rel": "self",
"type": "application/activity+json",
"href": "https://test.nextcloud.com/apps/social/@test"
},
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://test.nextcloud.com/apps/social/ostatus/follow/?uri={uri}"
}
]
}
- The remote instance will replace
{uri}
with the account (maxence@test.nextcloud.com) and open that link in the same popup. The destination is on the instance of Nextcloud - The user identify himself on the instance of Nextcloud and click on 'Follow', initiating the process of following the remote account from the user's account on Nextcloud/Social.
Now the problem.
template
is not an official entry for webfinger
. Theorically, this template URI should be available in /.well-known/host-info
, as it is the same value for every account, but mastodon use the info from webfinger, maybe to also check that the account you used in the form exists on the instance.
The array $entries
this PR added to addLink
allows the Social App to add non official entries to the array at the generation of the Link
:
$subscribe = $this->urlGenerator->linkToRouteAbsolute('social.OStatus.subscribe') . '?uri={uri}';
$response->addLink(
'http://ostatus.org/schema/1.0/subscribe',
'',
'',
null,
null,
['template' => $subscribe]
);
what's next here? |
moving to 23 |
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
For now this is modified JrdResponse from nextcloud/server#26178 Let's hope that we can switch to the OCP one in NC 25 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Some protocol like OStatus needs a 'template' entry to add an URI Template to the to the
link
, and this is not defined in the RFC:https://www.w3.org/community/ostatus/wiki/Workflow
This allow an app (ie. Social) to stay compatible with those protocols