Skip to content

fix(caldav): stricter default calendar checks - #45667

Merged
st3iny merged 1 commit into
masterfrom
fix/caldav/strict-default-calendar-checks
Jul 23, 2024
Merged

fix(caldav): stricter default calendar checks#45667
st3iny merged 1 commit into
masterfrom
fix/caldav/strict-default-calendar-checks

Conversation

@st3iny

@st3inyst3iny commented Jun 4, 2024

Copy link
Copy Markdown
Member

Summary

Reject calendars that

  • are subscriptions
  • are not writable
  • are shared by a user
  • are deleted
  • don't support VEVENTs

Checklist

@st3inyst3iny added 2. developing Work in progress feature: caldav Related to CalDAV internals labels Jun 4, 2024
@st3inyst3iny self-assigned this Jun 4, 2024
@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable29

@st3iny
st3inyforce-pushed the fix/caldav/strict-default-calendar-checks branch from 9db8a35 to 3d5e847CompareJune 5, 2024 07:11
@st3inyst3iny added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 5, 2024
@st3inyst3iny added this to the Nextcloud 30 milestone Jun 5, 2024
@st3inyst3iny added the bug label Jun 5, 2024
@st3iny
st3iny marked this pull request as ready for review June 5, 2024 07:13
@st3iny
st3inyforce-pushed the fix/caldav/strict-default-calendar-checks branch from 3d5e847 to a0d8728CompareJune 5, 2024 07:27
@st3iny

Copy link
Copy Markdown
MemberAuthor

I just realized that the fallback propFind method is also broken, when a task list is on top. So we have to do the same checks in our schedule plugin, too.

I'll push another commit and some tests.

$objectTree,
$this->databaseConnection,
$this->userSession->getUser()
$this->userSession->getUser(),

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 4 of OCA\DAV\DAV\CustomPropertiesBackend::__construct cannot be null, possibly null value provided
$this->server->tree,
\OC::$server->getDatabaseConnection(),
\OC::$server->getUserSession()->getUser()
\OC::$server->getUserSession()->getUser(),

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 4 of OCA\DAV\DAV\CustomPropertiesBackend::__construct cannot be null, possibly null value provided
$this->server->tree,
\OC::$server->getDatabaseConnection(),
\OC::$server->getUserSession()->getUser()
\OC::$server->getUserSession()->getUser(),

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getUserSession has been marked as deprecated
Reject calendars that
- are subscriptions
- are not writable
- are shared with a user
- are deleted
- don't support VEVENTs
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny
st3inyforce-pushed the fix/caldav/strict-default-calendar-checks branch from a635a94 to cbea787CompareJuly 22, 2024 13:24

@miaulalalamiaulalala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment threadapps/dav/lib/CalDAV/DefaultCalendarValidator.php
@st3iny
st3iny merged commit e54d39b into masterJul 23, 2024
@st3iny
st3iny deleted the fix/caldav/strict-default-calendar-checks branch July 23, 2024 06:40
@blizzzblizzz mentioned this pull request Jul 24, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugfeature: caldavRelated to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CalDAV error when trying to add a calendar event [iCalendar objects must at least have a component of type VTODO]

5 participants

@st3iny@ChristophWurst@tcitworld@miaulalala@github-advanced-security