Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

ArtificialOwl
Copy link
Member

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

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@rullzer rullzer added 3. to review Waiting for reviews enhancement labels Mar 22, 2021
@rullzer rullzer added this to the Nextcloud 22 milestone Mar 22, 2021
@@ -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
Copy link
Member

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?

Copy link
Member Author

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]
		);

This was referenced May 20, 2021
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@blizzz
Copy link
Member

blizzz commented Jun 2, 2021

what's next here?

@MorrisJobke MorrisJobke mentioned this pull request Jun 10, 2021
59 tasks
@blizzz blizzz mentioned this pull request Jun 16, 2021
45 tasks
@blizzz
Copy link
Member

blizzz commented Jun 16, 2021

moving to 23

@blizzz blizzz modified the milestones: Nextcloud 22, Nextcloud 23 Jun 16, 2021
@skjnldsv skjnldsv mentioned this pull request Oct 13, 2021
@skjnldsv skjnldsv modified the milestones: Nextcloud 23, Nextcloud 24 Oct 21, 2021
@skjnldsv skjnldsv mentioned this pull request Mar 24, 2022
@blizzz blizzz mentioned this pull request Mar 31, 2022
This was referenced Apr 7, 2022
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 20, 2022
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>
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 20, 2022
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>
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 20, 2022
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>
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 20, 2022
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>
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 20, 2022
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>
@blizzz blizzz modified the milestones: Nextcloud 24, Nextcloud 25 Apr 21, 2022
CarlSchwan added a commit to nextcloud/social that referenced this pull request Apr 21, 2022
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>
This was referenced Aug 12, 2022
This was referenced Aug 24, 2022
This was referenced Sep 6, 2022
@ChristophWurst ChristophWurst deleted the enh/noid/webfinger-ostatus branch September 15, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants