Skip to content

Add Feature-Policy header - #16613

Merged
rullzer merged 3 commits into
masterfrom
enh/featurepolicy
Aug 11, 2019
Merged

Add Feature-Policy header#16613
rullzer merged 3 commits into
masterfrom
enh/featurepolicy

Conversation

@rullzer

Copy link
Copy Markdown
Member

No description provided.

@rullzerrullzer added this to the Nextcloud 17 milestone Jul 30, 2019
@rullzerrullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 1, 2019
@rullzer

Copy link
Copy Markdown
MemberAuthor

Review time :)

This is not all the features. But other things will be added later in steps.

georgehrke
georgehrke previously requested changes Aug 1, 2019

@georgehrkegeorgehrke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code looks good, just some minor changes.

To test just make sure that the header is there?

Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
@rullzer

Copy link
Copy Markdown
MemberAuthor

Yes check the header is there.
You could check with talk. That should fail hard now until I provide a patch there ;)

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good otherwise

Comment threadlib/private/AppFramework/DependencyInjection/DIContainer.php Outdated
Comment threadlib/private/Security/FeaturePolicy/FeaturePolicyManager.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
Comment threadlib/public/AppFramework/Http/EmptyFeaturePolicy.php Outdated
@rullzer
rullzer requested a review from georgehrkeAugust 5, 2019 19:34
@rullzer

Copy link
Copy Markdown
MemberAuthor

All done @ChristophWurst 😉

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good!

* @return Response
*/
public function afterController($controller, $methodName, Response $response): Response {
$policy = !is_null($response->getFeaturePolicy()) ? $response->getFeaturePolicy() : new FeaturePolicy();

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.

Suggested change
$policy = !is_null($response->getFeaturePolicy()) ? $response->getFeaturePolicy() :newFeaturePolicy();
$policy = $response->getFeaturePolicy() ??newFeaturePolicy();

Could that work?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Probably. But lets leave it for now.

@georgehrkegeorgehrke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Tested and works

@danxuliudanxuliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested (with Talk) and works 👍

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This adds the events and the classes to modify the feature policy.
It also adds a default restricted feature policy.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer

Copy link
Copy Markdown
MemberAuthor

Pushed tests. Will merge once CI is happy

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
rullzer merged commit 773ce9e into masterAug 11, 2019
@rullzer
rullzer deleted the enh/featurepolicy branch August 11, 2019 08:17
MorrisJobke added a commit to nextcloud/documentation that referenced this pull request Aug 10, 2020
* LoadAdditionalScripts (@rullzer) - nextcloud/server#16641
* LoadViewerEvent (@skjnldsv) - nextcloud/viewer#271
* RegisterDirectEditorEvent (@juliushaertl) - nextcloud/server#17625
* typed events for files scanner (@ChristophWurst) - nextcloud/server#18351
* typed events for group mangement (@ChristophWurst) - nextcloud/server#18350
* AddContentSecurityPolicyEvent (@rullzer) - nextcloud/server#15730
* UserLiveStatusEvent (@georgehrke) - nextcloud/server#21186
* password_policy events (@ChristophWurst) - nextcloud/server#18019
* AddFeaturePolicyEvent (@rullzer) - nextcloud/server#16613
* ShareCreatedEvent (@rullzer) - nextcloud/server#18384
* LoadSettingsScriptsEvent (@blizzz) - nextcloud/server#21475
* flow events (@rullzer) - nextcloud/server#18535
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
backportbot-nextcloudBot pushed a commit to nextcloud/documentation that referenced this pull request Aug 10, 2020
* LoadAdditionalScripts (@rullzer) - nextcloud/server#16641
* LoadViewerEvent (@skjnldsv) - nextcloud/viewer#271
* RegisterDirectEditorEvent (@juliushaertl) - nextcloud/server#17625
* typed events for files scanner (@ChristophWurst) - nextcloud/server#18351
* typed events for group mangement (@ChristophWurst) - nextcloud/server#18350
* AddContentSecurityPolicyEvent (@rullzer) - nextcloud/server#15730
* UserLiveStatusEvent (@georgehrke) - nextcloud/server#21186
* password_policy events (@ChristophWurst) - nextcloud/server#18019
* AddFeaturePolicyEvent (@rullzer) - nextcloud/server#16613
* ShareCreatedEvent (@rullzer) - nextcloud/server#18384
* LoadSettingsScriptsEvent (@blizzz) - nextcloud/server#21475
* flow events (@rullzer) - nextcloud/server#18535
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
MorrisJobke added a commit to nextcloud/documentation that referenced this pull request Aug 10, 2020
* LoadAdditionalScripts (@rullzer) - nextcloud/server#16641
* LoadViewerEvent (@skjnldsv) - nextcloud/viewer#271
* RegisterDirectEditorEvent (@juliushaertl) - nextcloud/server#17625
* typed events for files scanner (@ChristophWurst) - nextcloud/server#18351
* typed events for group mangement (@ChristophWurst) - nextcloud/server#18350
* AddContentSecurityPolicyEvent (@rullzer) - nextcloud/server#15730
* UserLiveStatusEvent (@georgehrke) - nextcloud/server#21186
* password_policy events (@ChristophWurst) - nextcloud/server#18019
* AddFeaturePolicyEvent (@rullzer) - nextcloud/server#16613
* ShareCreatedEvent (@rullzer) - nextcloud/server#18384
* LoadSettingsScriptsEvent (@blizzz) - nextcloud/server#21475
* flow events (@rullzer) - nextcloud/server#18535
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
MorrisJobke added a commit to nextcloud/documentation that referenced this pull request Aug 10, 2020
* LoadAdditionalScripts (@rullzer) - nextcloud/server#16641
* LoadViewerEvent (@skjnldsv) - nextcloud/viewer#271
* RegisterDirectEditorEvent (@juliushaertl) - nextcloud/server#17625
* typed events for files scanner (@ChristophWurst) - nextcloud/server#18351
* typed events for group mangement (@ChristophWurst) - nextcloud/server#18350
* AddContentSecurityPolicyEvent (@rullzer) - nextcloud/server#15730
* UserLiveStatusEvent (@georgehrke) - nextcloud/server#21186
* password_policy events (@ChristophWurst) - nextcloud/server#18019
* AddFeaturePolicyEvent (@rullzer) - nextcloud/server#16613
* ShareCreatedEvent (@rullzer) - nextcloud/server#18384
* LoadSettingsScriptsEvent (@blizzz) - nextcloud/server#21475
* flow events (@rullzer) - nextcloud/server#18535
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rullzer@georgehrke@ChristophWurst@kesselb@danxuliu