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

Allow to have multiple links per public calendar #20214

Closed

Conversation

tcitworld
Copy link
Member

@tcitworld tcitworld commented Mar 28, 2020

Needed for #20096

  • Test with cdav-library
  • Adapt Activity and everything else that uses '\OCA\DAV\CalDAV\CalDavBackend::publishCalendar' events

Adding a public link is still the old way:

<o:publish-calendar xmlns:o="http://calendarserver.org/ns/"/>

Removing all public links is just like we used to unpublish

<o:unpublish-calendar xmlns:o="http://calendarserver.org/ns/"/>

We now have the following for unpublishing a specific link (we can change nc:unpublish-calendar to something else).

<o:unpublish-calendar xmlns:o="http://nextcloud.com/ns/">urltounpublish</o:unpublish-calendar>

The public URLs are exposed this way:

<x1:publish-urls xmlns:d="DAV:" xmlns:x1="http://nextcloud.com/ns/">
	<d:href>urltopublish</d:href>
	<d:href>secondurltopublish</d:href>
</x1:publish-urls>

publish-url is still available and gives the first URL

<x1:publish-url xmlns:d="DAV:" xmlns:x1="http://calendarserver.org/ns/">
	<d:href>urltopublish</d:href>
</x1:publish-url>

Note : not sure if the collection of public calendars should contain unique calendars or one calendar per public link. Need help here @georgehrke.

Adding a public link is still the old way:

```xml
<o:publish-calendar xmlns:o="http://calendarserver.org/ns/"/>
```

Removing all public links is just like we used to unpublish
```xml
<o:unpublish-calendar xmlns:o="http://calendarserver.org/ns/"/>
```

We now have the following for unpublishing a specific link
```xml
<o:unpublish-calendar xmlns:o="http://nextcloud.com/ns/">urltounpublish</o:unpublish-calendar>
```

The public URLs are exposed this way:
```xml
<x1:publish-urls xmlns:d="DAV:" xmlns:x1="http://nextcloud.com/ns/">
	<d:href>urltopublish</d:href>
	<d:href>secondurltopublish</d:href>
</x1:publish-urls>
```

`publish-url` is still available and give the first URL
```xml
<x1:publish-url xmlns:d="DAV:" xmlns:x1="http://calendarserver.org/ns/">
	<d:href>urltopublish</d:href>
</x1:publish-url>
```

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@tcitworld tcitworld added the 2. developing Work in progress label Mar 28, 2020
@tcitworld tcitworld added this to the Nextcloud 19 milestone Mar 28, 2020
@tcitworld tcitworld linked an issue Mar 28, 2020 that may be closed by this pull request
19 tasks
@tcitworld tcitworld removed a link to an issue Mar 28, 2020
19 tasks
@georgehrke
Copy link
Member

georgehrke commented Mar 28, 2020

I actually had something slightly different in mind:

  1. If you put multiple <d:href> into one <x1:publish-urls>, you can't save different permissions for them. Different permissions (and other fields like show busy only, expiry date, etc.) will require a slightly more complex XML structure.

Our current response for ordinary shares looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:" xmlns:oc="http://owncloud.org/ns">
	<D:response>
		<D:href>/foo</D:href>
		<D:propstat>
			<D:prop>
				<oc:invite>
					<oc:user>
						<D:href>principal:principals/users/admin</D:href>
						<oc:common-name>John Doe</oc:common-name>
						<oc:invite-accepted/>
						<oc:access>
							<oc:read-write/>
						</oc:access>
					</oc:user>
				</oc:invite>
			</D:prop>
			<D:status>HTTP/1.1 200 OK</D:status>
		</D:propstat>
	</D:response>
</D:multistatus>

What i had in mind was something like this:

<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:" xmlns:oc="http://owncloud.org/ns">
	<D:response>
		<D:href>/foo</D:href>
		<D:propstat>
			<D:prop>
				<oc:invite>
					<oc:user>
						<D:href>principal:principals/users/admin</D:href>
						<oc:common-name>John Doe</oc:common-name>
						<oc:invite-accepted/>
						<oc:access>
							<oc:read-write/>
						</oc:access>
					</oc:user>
                                        <nc:public>
						<d:href>urltopublish</d:href>
                                                <nc:label>Label for this read-only link</nc:label>
                                                <nc:expiry-date> 20201003T000000Z</nc:expiry-date>
						<oc:access>
							<oc:read/>
						</oc:access>
                                        </nc:public>
                                        <nc:public>
						<d:href>urltopublish2</d:href>
                                                <nc:label>Label for this read-write link</nc:label>
						<oc:access>
							<oc:read-write/>
						</oc:access>
                                        </nc:public>
                                        <nc:public>
						<d:href>urltopublish3</d:href>
                                                <nc:label>Label for this read-only with busy link</nc:label>
						<oc:access>
							<oc:read/>
                                                        <nc:busy-only/>
						</oc:access>
                                        </nc:public>
				</oc:invite>
			</D:prop>
			<D:status>HTTP/1.1 200 OK</D:status>
		</D:propstat>
	</D:response>
</D:multistatus>

@tcitworld Does that make sense? :)

EDIT: Similar to <nc:public>, we can also have <nc:public-email>, <nc:user-federated>, <nc:group-federated>, and possibly more.

@tcitworld
Copy link
Member Author

Thanks for clarification ! Definitely makes sense. Would the public link elements be managed through oc:set and oc:remove as well ?

@tcitworld
Copy link
Member Author

Also <nc:label> may reuse <oc:commonName> or <oc:summary> ?

@georgehrke
Copy link
Member

Would the public link elements be managed through oc:set and oc:remove as well ?

Yes, with the exception of creating new published calendars. (because for using oc:set and oc:remove you need a d:href, but we don't want clients to pick a token themselves. It has to be generated randomly on the server).

For sharing a public link via email or federated shares, we would be using something like mailto:janedoe@example.com and nc-federated:johndoe@example.cloud as href.

Also <nc:label> may reuse <oc:commonName> or <oc:summary> ?

Yes, looking at the RFC, we should be using <oc:common-name> as a label and <oc:summary> as a note to sharees.


What should d:href look like for public calendars?
<d:href>http://example.com/remote.php/dav/public-calendars/token123</href> or <d:href>nc-public-token:token123</d:href>. I'm worried that the first one is too ambiguous and might cause conflicts if we add other sharing types later.

@tcitworld
Copy link
Member Author

<d:href>http://example.com/remote.php/dav/public-calendars/token123 or <d:href>nc-public-token:token123</d:href>. I'm worried that the first one is too ambiguous and might cause conflicts if we add other sharing types later.

However we can't discover the public calendars collection, right? So the public-calendars endpoint would be hardcoded.

@georgehrke
Copy link
Member

However we can't discover the public calendars collection, right? So the public-calendars endpoint would be hardcoded.

I think in that case I would still like to stick to <d:href>nc-public-token:token123</d:href> and then include the following:

<nc:public>
    <d:href>nc-public-token:token123</d:href>
    <nc:public-caldav-endpoint>
         <d:href>http://example.com/remote.php/dav/public-calendars/token123</href>
    </nc:public-caldav-endpoint>
    ...
</nc:public>

@georgehrke georgehrke modified the milestones: Nextcloud 19, Nextcloud 20 Apr 3, 2020
@georgehrke
Copy link
Member

Moved to Nc 20 milestone, since we are past feature freeze

@georgehrke
Copy link
Member

Off-topic:
@rullzer I feel like we could do a better job properly announcing feature freeze publicly :)
It wasn't even included in https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule for this release.

@MorrisJobke MorrisJobke mentioned this pull request Aug 11, 2020
57 tasks
@MorrisJobke
Copy link
Member

@georgehrke We seem to miss the next feature freeze as well. Sorry @tcitworld :/

@rullzer rullzer modified the milestones: Nextcloud 20, Nextcloud 21 Aug 20, 2020
This was referenced Dec 14, 2020
@ChristophWurst
Copy link
Member

and we are in beta again 😭

@ChristophWurst ChristophWurst removed this from the Nextcloud 21 milestone Dec 22, 2020
@ChristophWurst ChristophWurst added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Dec 22, 2020
@codingHahn
Copy link

How is the status on this? The next feature freeze seems to be tomorrow

@tcitworld
Copy link
Member Author

As per the labels, still being developed.

@skjnldsv skjnldsv added 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Feb 21, 2024
@skjnldsv
Copy link
Member

Hey Thomas!
This PR has been on hold for a while, do we still want this?
I'm cleaning up things and suggest we close it otherwise.

Many conflicts and outdated history... 🙈

@skjnldsv skjnldsv added the stale Ticket or PR with no recent activity label Feb 27, 2024
@susnux susnux added this to the Nextcloud 30 milestone Apr 18, 2024
@skjnldsv
Copy link
Member

skjnldsv commented May 2, 2024

Closing this pull request due to lack of recent activity and updates. We appreciate your contribution and encourage you to reopen or provide further updates if necessary. ☺️
Our aim is to keep the project moving forward with active collaboration. Thank you for your understanding and continued support! 🙏

@skjnldsv skjnldsv closed this May 2, 2024
@skjnldsv skjnldsv deleted the feature/20096/calendar-publishing-multiple-links branch May 2, 2024 14:34
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress stale Ticket or PR with no recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants