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

FeaturePolicy => PermissionPolicy #23825

Closed
wants to merge 3 commits into from
Closed

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Nov 1, 2020

We already had the FeaturePolicy header. However this call got renamed
to PermisionPolicy. Here we move this over. The old mechanism stays
there it just won't get extended. So apps that use the FeaturePolicy
will not stop to work.

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

@rullzer rullzer added enhancement 2. developing Work in progress labels Nov 1, 2020
@rullzer rullzer added this to the Nextcloud 21 milestone Nov 1, 2020
@rullzer rullzer force-pushed the enh/permission_policy branch 3 times, most recently from acbb930 to f65ce54 Compare November 19, 2020 14:51
@faily-bot
Copy link

faily-bot bot commented Nov 19, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 35702: failure

checkers

nodb

Show full log
There were 26 warnings:

1) Test\AppFramework\Controller\AuthPublicShareControllerTest::testAuthenticateAuthenticated
Trying to configure method "isAuthenticated" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) OCA\DAV\Tests\unit\CalDAV\CalendarTest::testConfidentialClassification with data set #0 (3, false)
No method rule is set

3) OCA\DAV\Tests\Command\MoveCalendarTest::testMove
Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.

4) OCA\DAV\Tests\unit\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJobTest::testRun
Passing an array of interface names to createMock() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.
Passing an array of interface names to getMockBuilder() for creating a test double that implements multiple interfaces is deprecated and will no longer be supported in PHPUnit 9.

5) ExpirationTest::testParseRetentionObligation with data set #0 ('disabled', null, null, null)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

6) ExpirationTest::testParseRetentionObligation with data set #1 ('auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

7) ExpirationTest::testParseRetentionObligation with data set #2 ('auto,auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

8) ExpirationTest::testParseRetentionObligation with data set #3 ('auto, auto', 30, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

9) ExpirationTest::testParseRetentionObligation with data set #4 ('auto, 3', -1, 3, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

10) ExpirationTest::testParseRetentionObligation with data set #5 ('5, auto', 5, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

11) ExpirationTest::testParseRetentionObligation with data set #6 ('3, 5', 3, 5, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

12) ExpirationTest::testParseRetentionObligation with data set #7 ('10, 3', 10, 10, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

13) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #0 ('disabled', null, null, null)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

14) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #1 ('auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

15) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #2 ('auto,auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

16) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #3 ('auto, auto', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

17) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #4 ('auto, 3', -1, 3, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

18) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #5 ('5, auto', 5, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

19) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #6 ('3, 5', 3, 5, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

20) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #7 ('10, 3', 10, 10, false)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

21) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #8 ('g,a,r,b,a,g,e', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

22) OCA\Files_Versions\Tests\ExpirationTest::testParseRetentionObligation with data set #9 ('-3,8', -1, -1, true)
assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

23) OCA\Settings\Tests\Mailer\NewUserMailHelperTest::testGenerateTemplateWithPasswordResetToken
Method getTime may not return value of type string, its return declaration is ": int"

24) OCA\TwoFactorBackupCodes\Tests\Unit\Listener\ActivityPublisherTest::testHandleCodesGeneratedEvent
Method publish may not return value of type Mock_IEvent_34632f90, its return declaration is ": void"

25) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #1 ('app2', '1.0.1', '1.0.0', '1.0.0', true, array('user1'), array(array('user1')))
Method notify may not return value of type Mock_INotification_082bcbb5, its return declaration is ": void"

26) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #2 ('app3', '1.0.1', false, false, true, array('user2', 'user3'), array(array('user2'), array('user3')))
Method notify may not return value of type Mock_INotification_082bcbb5, its return declaration is ": void"

--

There were 3 failures:

1) Test\AppFramework\Controller\ControllerTest::testFormatDataResponseJSON
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     'Cache-Control' => 'no-cache, no-store, must-revalidate'
     'Content-Type' => 'application/json; charset=utf-8'
     'Content-Security-Policy' => 'default-src 'none';base-uri '...'none''
-    'Feature-Policy' => 'autoplay 'none';camera 'none'...'none''
     'X-Robots-Tag' => 'none'
+    'Permissions-Policy' => 'autoplay=() camera=() fullscr...ent=()'
 )

/drone/src/tests/lib/AppFramework/Controller/ControllerTest.php:125

2) Test\AppFramework\Http\DataResponseTest::testConstructorAllowsToSetHeaders
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'Cache-Control' => 'no-cache, no-store, must-revalidate'
     'Content-Security-Policy' => 'default-src 'none';base-uri '...'none''
-    'Feature-Policy' => 'autoplay 'none';camera 'none'...'none''
     'X-Robots-Tag' => 'none'
     'test' => 'something'
+    'Permissions-Policy' => 'autoplay=() camera=() fullscr...ent=()'
 )

/drone/src/tests/lib/AppFramework/Http/DataResponseTest.php:76

3) Test\AppFramework\Http\ResponseTest::testSetHeaders
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     'Something-Else' => 'hi'
     'X-Robots-Tag' => 'none'
     'Content-Security-Policy' => 'default-src 'none';base-uri '...'none''
-    'Feature-Policy' => 'autoplay 'none';camera 'none'...'none''
+    'Permissions-Policy' => 'autoplay=() camera=() fullscr...ent=()'
 )

/drone/src/tests/lib/AppFramework/Http/ResponseTest.php:63

@rullzer rullzer mentioned this pull request Dec 14, 2020
59 tasks
@rullzer rullzer modified the milestones: Nextcloud 21, Nextcloud 22 Dec 15, 2020
@MorrisJobke MorrisJobke mentioned this pull request May 20, 2021
@MorrisJobke
Copy link
Member

cc @LukasReschke

🏓

@MorrisJobke MorrisJobke mentioned this pull request May 26, 2021
98 tasks
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 22, Nextcloud 23 Jun 2, 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
@blizzz blizzz modified the milestones: Nextcloud 24, Nextcloud 25 Apr 21, 2022
We already had the FeaturePolicy header. However this call got renamed
to PermisionPolicy. Here we move this over. The old mechanism stays
there it just won't get extended. So apps that use the FeaturePolicy
will not stop to work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
Copy link
Contributor

kesselb commented May 30, 2023

Rebased the branch.
Replaced 21 with 28.
Fixed the namespace for AddPermissionsPolicyEvent.

@solracsf solracsf added this to the Nextcloud 28 milestone May 31, 2023
@solracsf solracsf added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 31, 2023
@solracsf
Copy link
Member

solracsf commented Jun 4, 2023

CI is red 🔴

@@ -35,6 +35,7 @@
* should require no modification at all for most use-cases.
*
* @since 17.0.0
* @depreacted 21.0.0 use \OCP\AppFramework\Http\PermissionPolicy
Copy link
Member

@MichaIng MichaIng Jun 5, 2023

Choose a reason for hiding this comment

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

Suggested change
* @depreacted 21.0.0 use \OCP\AppFramework\Http\PermissionPolicy
* @deprecated 28.0.0 use \OCP\AppFramework\Http\PermissionPolicy

That typo appears a few more times.

* notice that Nextcloud ships already with sensible defaults and those policies
* should require no modification at all for most use-cases.
*
* @since 21.0.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @since 21.0.0
* @since 28.0.0

Comment on lines +352 to +355
/**
* @since 17.0.0
* @depreacted 28.0.0 Use setPermissionPolicy
*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* @since 17.0.0
* @depreacted 28.0.0 Use setPermissionPolicy
*/
/**
* @since 28.0.0
*/

@LukasReschke LukasReschke removed their request for review June 5, 2023 10:10
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@skjnldsv skjnldsv removed this from the Nextcloud 29 milestone Feb 27, 2024
@skjnldsv
Copy link
Member

As there is no feedback since a while I will close this ticket.
If you will decide to work on this feature again and if it hasn't been fixed or implemented already, feel free to re-open and solve the various conflicts.

@skjnldsv skjnldsv closed this Feb 27, 2024
@skjnldsv skjnldsv removed the 3. to review Waiting for reviews label Feb 27, 2024
@skjnldsv skjnldsv deleted the enh/permission_policy branch February 27, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants