@@ -31,215 +31,215 @@ |
||
31 | 31 | * @package OC\Security\CSP |
32 | 32 | */ |
33 | 33 | class ContentSecurityPolicy extends \OCP\AppFramework\Http\ContentSecurityPolicy { |
34 | - /** |
|
35 | - * @return boolean |
|
36 | - */ |
|
37 | - public function isInlineScriptAllowed(): bool { |
|
38 | - return $this->inlineScriptAllowed; |
|
39 | - } |
|
40 | - |
|
41 | - /** |
|
42 | - * @param boolean $inlineScriptAllowed |
|
43 | - */ |
|
44 | - public function setInlineScriptAllowed(bool $inlineScriptAllowed) { |
|
45 | - $this->inlineScriptAllowed = $inlineScriptAllowed; |
|
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * @return boolean |
|
50 | - */ |
|
51 | - public function isEvalScriptAllowed(): bool { |
|
52 | - return $this->evalScriptAllowed; |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * @param boolean $evalScriptAllowed |
|
57 | - * |
|
58 | - * @deprecated 17.0.0 Unsafe eval should not be used anymore. |
|
59 | - */ |
|
60 | - public function setEvalScriptAllowed(bool $evalScriptAllowed) { |
|
61 | - $this->evalScriptAllowed = $evalScriptAllowed; |
|
62 | - } |
|
63 | - |
|
64 | - /** |
|
65 | - * @return array |
|
66 | - */ |
|
67 | - public function getAllowedScriptDomains(): array { |
|
68 | - return $this->allowedScriptDomains; |
|
69 | - } |
|
70 | - |
|
71 | - /** |
|
72 | - * @param array $allowedScriptDomains |
|
73 | - */ |
|
74 | - public function setAllowedScriptDomains(array $allowedScriptDomains) { |
|
75 | - $this->allowedScriptDomains = $allowedScriptDomains; |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * @return boolean |
|
80 | - */ |
|
81 | - public function isInlineStyleAllowed(): bool { |
|
82 | - return $this->inlineStyleAllowed; |
|
83 | - } |
|
84 | - |
|
85 | - /** |
|
86 | - * @param boolean $inlineStyleAllowed |
|
87 | - */ |
|
88 | - public function setInlineStyleAllowed(bool $inlineStyleAllowed) { |
|
89 | - $this->inlineStyleAllowed = $inlineStyleAllowed; |
|
90 | - } |
|
91 | - |
|
92 | - /** |
|
93 | - * @return array |
|
94 | - */ |
|
95 | - public function getAllowedStyleDomains(): array { |
|
96 | - return $this->allowedStyleDomains; |
|
97 | - } |
|
98 | - |
|
99 | - /** |
|
100 | - * @param array $allowedStyleDomains |
|
101 | - */ |
|
102 | - public function setAllowedStyleDomains(array $allowedStyleDomains) { |
|
103 | - $this->allowedStyleDomains = $allowedStyleDomains; |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * @return array |
|
108 | - */ |
|
109 | - public function getAllowedImageDomains(): array { |
|
110 | - return $this->allowedImageDomains; |
|
111 | - } |
|
112 | - |
|
113 | - /** |
|
114 | - * @param array $allowedImageDomains |
|
115 | - */ |
|
116 | - public function setAllowedImageDomains(array $allowedImageDomains) { |
|
117 | - $this->allowedImageDomains = $allowedImageDomains; |
|
118 | - } |
|
119 | - |
|
120 | - /** |
|
121 | - * @return array |
|
122 | - */ |
|
123 | - public function getAllowedConnectDomains(): array { |
|
124 | - return $this->allowedConnectDomains; |
|
125 | - } |
|
126 | - |
|
127 | - /** |
|
128 | - * @param array $allowedConnectDomains |
|
129 | - */ |
|
130 | - public function setAllowedConnectDomains(array $allowedConnectDomains) { |
|
131 | - $this->allowedConnectDomains = $allowedConnectDomains; |
|
132 | - } |
|
133 | - |
|
134 | - /** |
|
135 | - * @return array |
|
136 | - */ |
|
137 | - public function getAllowedMediaDomains(): array { |
|
138 | - return $this->allowedMediaDomains; |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * @param array $allowedMediaDomains |
|
143 | - */ |
|
144 | - public function setAllowedMediaDomains(array $allowedMediaDomains) { |
|
145 | - $this->allowedMediaDomains = $allowedMediaDomains; |
|
146 | - } |
|
147 | - |
|
148 | - /** |
|
149 | - * @return array |
|
150 | - */ |
|
151 | - public function getAllowedObjectDomains(): array { |
|
152 | - return $this->allowedObjectDomains; |
|
153 | - } |
|
154 | - |
|
155 | - /** |
|
156 | - * @param array $allowedObjectDomains |
|
157 | - */ |
|
158 | - public function setAllowedObjectDomains(array $allowedObjectDomains) { |
|
159 | - $this->allowedObjectDomains = $allowedObjectDomains; |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * @return array |
|
164 | - */ |
|
165 | - public function getAllowedFrameDomains(): array { |
|
166 | - return $this->allowedFrameDomains; |
|
167 | - } |
|
168 | - |
|
169 | - /** |
|
170 | - * @param array $allowedFrameDomains |
|
171 | - */ |
|
172 | - public function setAllowedFrameDomains(array $allowedFrameDomains) { |
|
173 | - $this->allowedFrameDomains = $allowedFrameDomains; |
|
174 | - } |
|
175 | - |
|
176 | - /** |
|
177 | - * @return array |
|
178 | - */ |
|
179 | - public function getAllowedFontDomains(): array { |
|
180 | - return $this->allowedFontDomains; |
|
181 | - } |
|
182 | - |
|
183 | - /** |
|
184 | - * @param array $allowedFontDomains |
|
185 | - */ |
|
186 | - public function setAllowedFontDomains($allowedFontDomains) { |
|
187 | - $this->allowedFontDomains = $allowedFontDomains; |
|
188 | - } |
|
189 | - |
|
190 | - /** |
|
191 | - * @return array |
|
192 | - * @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains |
|
193 | - */ |
|
194 | - public function getAllowedChildSrcDomains(): array { |
|
195 | - return $this->allowedChildSrcDomains; |
|
196 | - } |
|
197 | - |
|
198 | - /** |
|
199 | - * @param array $allowedChildSrcDomains |
|
200 | - * @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains |
|
201 | - */ |
|
202 | - public function setAllowedChildSrcDomains($allowedChildSrcDomains) { |
|
203 | - $this->allowedChildSrcDomains = $allowedChildSrcDomains; |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * @return array |
|
208 | - */ |
|
209 | - public function getAllowedFrameAncestors(): array { |
|
210 | - return $this->allowedFrameAncestors; |
|
211 | - } |
|
212 | - |
|
213 | - /** |
|
214 | - * @param array $allowedFrameAncestors |
|
215 | - */ |
|
216 | - public function setAllowedFrameAncestors($allowedFrameAncestors) { |
|
217 | - $this->allowedFrameAncestors = $allowedFrameAncestors; |
|
218 | - } |
|
219 | - |
|
220 | - public function getAllowedWorkerSrcDomains(): array { |
|
221 | - return $this->allowedWorkerSrcDomains; |
|
222 | - } |
|
223 | - |
|
224 | - public function setAllowedWorkerSrcDomains(array $allowedWorkerSrcDomains) { |
|
225 | - $this->allowedWorkerSrcDomains = $allowedWorkerSrcDomains; |
|
226 | - } |
|
227 | - |
|
228 | - public function getAllowedFormActionDomains(): array { |
|
229 | - return $this->allowedFormActionDomains; |
|
230 | - } |
|
231 | - |
|
232 | - public function setAllowedFormActionDomains(array $allowedFormActionDomains): void { |
|
233 | - $this->allowedFormActionDomains = $allowedFormActionDomains; |
|
234 | - } |
|
235 | - |
|
236 | - |
|
237 | - public function getReportTo(): array { |
|
238 | - return $this->reportTo; |
|
239 | - } |
|
240 | - |
|
241 | - public function setReportTo(array $reportTo) { |
|
242 | - $this->reportTo = $reportTo; |
|
243 | - } |
|
34 | + /** |
|
35 | + * @return boolean |
|
36 | + */ |
|
37 | + public function isInlineScriptAllowed(): bool { |
|
38 | + return $this->inlineScriptAllowed; |
|
39 | + } |
|
40 | + |
|
41 | + /** |
|
42 | + * @param boolean $inlineScriptAllowed |
|
43 | + */ |
|
44 | + public function setInlineScriptAllowed(bool $inlineScriptAllowed) { |
|
45 | + $this->inlineScriptAllowed = $inlineScriptAllowed; |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * @return boolean |
|
50 | + */ |
|
51 | + public function isEvalScriptAllowed(): bool { |
|
52 | + return $this->evalScriptAllowed; |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * @param boolean $evalScriptAllowed |
|
57 | + * |
|
58 | + * @deprecated 17.0.0 Unsafe eval should not be used anymore. |
|
59 | + */ |
|
60 | + public function setEvalScriptAllowed(bool $evalScriptAllowed) { |
|
61 | + $this->evalScriptAllowed = $evalScriptAllowed; |
|
62 | + } |
|
63 | + |
|
64 | + /** |
|
65 | + * @return array |
|
66 | + */ |
|
67 | + public function getAllowedScriptDomains(): array { |
|
68 | + return $this->allowedScriptDomains; |
|
69 | + } |
|
70 | + |
|
71 | + /** |
|
72 | + * @param array $allowedScriptDomains |
|
73 | + */ |
|
74 | + public function setAllowedScriptDomains(array $allowedScriptDomains) { |
|
75 | + $this->allowedScriptDomains = $allowedScriptDomains; |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * @return boolean |
|
80 | + */ |
|
81 | + public function isInlineStyleAllowed(): bool { |
|
82 | + return $this->inlineStyleAllowed; |
|
83 | + } |
|
84 | + |
|
85 | + /** |
|
86 | + * @param boolean $inlineStyleAllowed |
|
87 | + */ |
|
88 | + public function setInlineStyleAllowed(bool $inlineStyleAllowed) { |
|
89 | + $this->inlineStyleAllowed = $inlineStyleAllowed; |
|
90 | + } |
|
91 | + |
|
92 | + /** |
|
93 | + * @return array |
|
94 | + */ |
|
95 | + public function getAllowedStyleDomains(): array { |
|
96 | + return $this->allowedStyleDomains; |
|
97 | + } |
|
98 | + |
|
99 | + /** |
|
100 | + * @param array $allowedStyleDomains |
|
101 | + */ |
|
102 | + public function setAllowedStyleDomains(array $allowedStyleDomains) { |
|
103 | + $this->allowedStyleDomains = $allowedStyleDomains; |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * @return array |
|
108 | + */ |
|
109 | + public function getAllowedImageDomains(): array { |
|
110 | + return $this->allowedImageDomains; |
|
111 | + } |
|
112 | + |
|
113 | + /** |
|
114 | + * @param array $allowedImageDomains |
|
115 | + */ |
|
116 | + public function setAllowedImageDomains(array $allowedImageDomains) { |
|
117 | + $this->allowedImageDomains = $allowedImageDomains; |
|
118 | + } |
|
119 | + |
|
120 | + /** |
|
121 | + * @return array |
|
122 | + */ |
|
123 | + public function getAllowedConnectDomains(): array { |
|
124 | + return $this->allowedConnectDomains; |
|
125 | + } |
|
126 | + |
|
127 | + /** |
|
128 | + * @param array $allowedConnectDomains |
|
129 | + */ |
|
130 | + public function setAllowedConnectDomains(array $allowedConnectDomains) { |
|
131 | + $this->allowedConnectDomains = $allowedConnectDomains; |
|
132 | + } |
|
133 | + |
|
134 | + /** |
|
135 | + * @return array |
|
136 | + */ |
|
137 | + public function getAllowedMediaDomains(): array { |
|
138 | + return $this->allowedMediaDomains; |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * @param array $allowedMediaDomains |
|
143 | + */ |
|
144 | + public function setAllowedMediaDomains(array $allowedMediaDomains) { |
|
145 | + $this->allowedMediaDomains = $allowedMediaDomains; |
|
146 | + } |
|
147 | + |
|
148 | + /** |
|
149 | + * @return array |
|
150 | + */ |
|
151 | + public function getAllowedObjectDomains(): array { |
|
152 | + return $this->allowedObjectDomains; |
|
153 | + } |
|
154 | + |
|
155 | + /** |
|
156 | + * @param array $allowedObjectDomains |
|
157 | + */ |
|
158 | + public function setAllowedObjectDomains(array $allowedObjectDomains) { |
|
159 | + $this->allowedObjectDomains = $allowedObjectDomains; |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * @return array |
|
164 | + */ |
|
165 | + public function getAllowedFrameDomains(): array { |
|
166 | + return $this->allowedFrameDomains; |
|
167 | + } |
|
168 | + |
|
169 | + /** |
|
170 | + * @param array $allowedFrameDomains |
|
171 | + */ |
|
172 | + public function setAllowedFrameDomains(array $allowedFrameDomains) { |
|
173 | + $this->allowedFrameDomains = $allowedFrameDomains; |
|
174 | + } |
|
175 | + |
|
176 | + /** |
|
177 | + * @return array |
|
178 | + */ |
|
179 | + public function getAllowedFontDomains(): array { |
|
180 | + return $this->allowedFontDomains; |
|
181 | + } |
|
182 | + |
|
183 | + /** |
|
184 | + * @param array $allowedFontDomains |
|
185 | + */ |
|
186 | + public function setAllowedFontDomains($allowedFontDomains) { |
|
187 | + $this->allowedFontDomains = $allowedFontDomains; |
|
188 | + } |
|
189 | + |
|
190 | + /** |
|
191 | + * @return array |
|
192 | + * @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains |
|
193 | + */ |
|
194 | + public function getAllowedChildSrcDomains(): array { |
|
195 | + return $this->allowedChildSrcDomains; |
|
196 | + } |
|
197 | + |
|
198 | + /** |
|
199 | + * @param array $allowedChildSrcDomains |
|
200 | + * @deprecated 15.0.0 use FrameDomains and WorkerSrcDomains |
|
201 | + */ |
|
202 | + public function setAllowedChildSrcDomains($allowedChildSrcDomains) { |
|
203 | + $this->allowedChildSrcDomains = $allowedChildSrcDomains; |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * @return array |
|
208 | + */ |
|
209 | + public function getAllowedFrameAncestors(): array { |
|
210 | + return $this->allowedFrameAncestors; |
|
211 | + } |
|
212 | + |
|
213 | + /** |
|
214 | + * @param array $allowedFrameAncestors |
|
215 | + */ |
|
216 | + public function setAllowedFrameAncestors($allowedFrameAncestors) { |
|
217 | + $this->allowedFrameAncestors = $allowedFrameAncestors; |
|
218 | + } |
|
219 | + |
|
220 | + public function getAllowedWorkerSrcDomains(): array { |
|
221 | + return $this->allowedWorkerSrcDomains; |
|
222 | + } |
|
223 | + |
|
224 | + public function setAllowedWorkerSrcDomains(array $allowedWorkerSrcDomains) { |
|
225 | + $this->allowedWorkerSrcDomains = $allowedWorkerSrcDomains; |
|
226 | + } |
|
227 | + |
|
228 | + public function getAllowedFormActionDomains(): array { |
|
229 | + return $this->allowedFormActionDomains; |
|
230 | + } |
|
231 | + |
|
232 | + public function setAllowedFormActionDomains(array $allowedFormActionDomains): void { |
|
233 | + $this->allowedFormActionDomains = $allowedFormActionDomains; |
|
234 | + } |
|
235 | + |
|
236 | + |
|
237 | + public function getReportTo(): array { |
|
238 | + return $this->reportTo; |
|
239 | + } |
|
240 | + |
|
241 | + public function setReportTo(array $reportTo) { |
|
242 | + $this->reportTo = $reportTo; |
|
243 | + } |
|
244 | 244 | |
245 | 245 | } |
@@ -41,63 +41,63 @@ |
||
41 | 41 | * @since 8.1.0 |
42 | 42 | */ |
43 | 43 | class ContentSecurityPolicy extends EmptyContentSecurityPolicy { |
44 | - /** @var bool Whether inline JS snippets are allowed */ |
|
45 | - protected $inlineScriptAllowed = false; |
|
46 | - /** @var bool Whether eval in JS scripts is allowed */ |
|
47 | - protected $evalScriptAllowed = false; |
|
48 | - /** @var array Domains from which scripts can get loaded */ |
|
49 | - protected $allowedScriptDomains = [ |
|
50 | - '\'self\'', |
|
51 | - ]; |
|
52 | - /** |
|
53 | - * @var bool Whether inline CSS is allowed |
|
54 | - * TODO: Disallow per default |
|
55 | - * @link https://github.com/owncloud/core/issues/13458 |
|
56 | - */ |
|
57 | - protected $inlineStyleAllowed = true; |
|
58 | - /** @var array Domains from which CSS can get loaded */ |
|
59 | - protected $allowedStyleDomains = [ |
|
60 | - '\'self\'', |
|
61 | - ]; |
|
62 | - /** @var array Domains from which images can get loaded */ |
|
63 | - protected $allowedImageDomains = [ |
|
64 | - '\'self\'', |
|
65 | - 'data:', |
|
66 | - 'blob:', |
|
67 | - ]; |
|
68 | - /** @var array Domains to which connections can be done */ |
|
69 | - protected $allowedConnectDomains = [ |
|
70 | - '\'self\'', |
|
71 | - ]; |
|
72 | - /** @var array Domains from which media elements can be loaded */ |
|
73 | - protected $allowedMediaDomains = [ |
|
74 | - '\'self\'', |
|
75 | - ]; |
|
76 | - /** @var array Domains from which object elements can be loaded */ |
|
77 | - protected $allowedObjectDomains = []; |
|
78 | - /** @var array Domains from which iframes can be loaded */ |
|
79 | - protected $allowedFrameDomains = []; |
|
80 | - /** @var array Domains from which fonts can be loaded */ |
|
81 | - protected $allowedFontDomains = [ |
|
82 | - '\'self\'', |
|
83 | - 'data:', |
|
84 | - ]; |
|
85 | - /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
86 | - protected $allowedChildSrcDomains = []; |
|
44 | + /** @var bool Whether inline JS snippets are allowed */ |
|
45 | + protected $inlineScriptAllowed = false; |
|
46 | + /** @var bool Whether eval in JS scripts is allowed */ |
|
47 | + protected $evalScriptAllowed = false; |
|
48 | + /** @var array Domains from which scripts can get loaded */ |
|
49 | + protected $allowedScriptDomains = [ |
|
50 | + '\'self\'', |
|
51 | + ]; |
|
52 | + /** |
|
53 | + * @var bool Whether inline CSS is allowed |
|
54 | + * TODO: Disallow per default |
|
55 | + * @link https://github.com/owncloud/core/issues/13458 |
|
56 | + */ |
|
57 | + protected $inlineStyleAllowed = true; |
|
58 | + /** @var array Domains from which CSS can get loaded */ |
|
59 | + protected $allowedStyleDomains = [ |
|
60 | + '\'self\'', |
|
61 | + ]; |
|
62 | + /** @var array Domains from which images can get loaded */ |
|
63 | + protected $allowedImageDomains = [ |
|
64 | + '\'self\'', |
|
65 | + 'data:', |
|
66 | + 'blob:', |
|
67 | + ]; |
|
68 | + /** @var array Domains to which connections can be done */ |
|
69 | + protected $allowedConnectDomains = [ |
|
70 | + '\'self\'', |
|
71 | + ]; |
|
72 | + /** @var array Domains from which media elements can be loaded */ |
|
73 | + protected $allowedMediaDomains = [ |
|
74 | + '\'self\'', |
|
75 | + ]; |
|
76 | + /** @var array Domains from which object elements can be loaded */ |
|
77 | + protected $allowedObjectDomains = []; |
|
78 | + /** @var array Domains from which iframes can be loaded */ |
|
79 | + protected $allowedFrameDomains = []; |
|
80 | + /** @var array Domains from which fonts can be loaded */ |
|
81 | + protected $allowedFontDomains = [ |
|
82 | + '\'self\'', |
|
83 | + 'data:', |
|
84 | + ]; |
|
85 | + /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
86 | + protected $allowedChildSrcDomains = []; |
|
87 | 87 | |
88 | - /** @var array Domains which can embed this Nextcloud instance */ |
|
89 | - protected $allowedFrameAncestors = [ |
|
90 | - '\'self\'', |
|
91 | - ]; |
|
88 | + /** @var array Domains which can embed this Nextcloud instance */ |
|
89 | + protected $allowedFrameAncestors = [ |
|
90 | + '\'self\'', |
|
91 | + ]; |
|
92 | 92 | |
93 | - /** @var array Domains from which web-workers can be loaded */ |
|
94 | - protected $allowedWorkerSrcDomains = []; |
|
93 | + /** @var array Domains from which web-workers can be loaded */ |
|
94 | + protected $allowedWorkerSrcDomains = []; |
|
95 | 95 | |
96 | - /** @var array Domains which can be used as target for forms */ |
|
97 | - protected $allowedFormActionDomains = [ |
|
98 | - '\'self\'', |
|
99 | - ]; |
|
96 | + /** @var array Domains which can be used as target for forms */ |
|
97 | + protected $allowedFormActionDomains = [ |
|
98 | + '\'self\'', |
|
99 | + ]; |
|
100 | 100 | |
101 | - /** @var array Locations to report violations to */ |
|
102 | - protected $reportTo = []; |
|
101 | + /** @var array Locations to report violations to */ |
|
102 | + protected $reportTo = []; |
|
103 | 103 | } |
@@ -31,50 +31,50 @@ |
||
31 | 31 | */ |
32 | 32 | interface IRoom { |
33 | 33 | |
34 | - /** |
|
35 | - * Get a unique ID for the room |
|
36 | - * |
|
37 | - * This id has to be unique within the backend |
|
38 | - * |
|
39 | - * @return string |
|
40 | - * @since 14.0.0 |
|
41 | - */ |
|
42 | - public function getId():string; |
|
34 | + /** |
|
35 | + * Get a unique ID for the room |
|
36 | + * |
|
37 | + * This id has to be unique within the backend |
|
38 | + * |
|
39 | + * @return string |
|
40 | + * @since 14.0.0 |
|
41 | + */ |
|
42 | + public function getId():string; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Get the display name for the room |
|
46 | - * |
|
47 | - * @return string |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function getDisplayName():string; |
|
44 | + /** |
|
45 | + * Get the display name for the room |
|
46 | + * |
|
47 | + * @return string |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function getDisplayName():string; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Get a list of groupIds that are allowed to access this room |
|
54 | - * |
|
55 | - * If an empty array is returned, no group restrictions are |
|
56 | - * applied. |
|
57 | - * |
|
58 | - * @return string[] |
|
59 | - * @since 14.0.0 |
|
60 | - */ |
|
61 | - public function getGroupRestrictions():array; |
|
52 | + /** |
|
53 | + * Get a list of groupIds that are allowed to access this room |
|
54 | + * |
|
55 | + * If an empty array is returned, no group restrictions are |
|
56 | + * applied. |
|
57 | + * |
|
58 | + * @return string[] |
|
59 | + * @since 14.0.0 |
|
60 | + */ |
|
61 | + public function getGroupRestrictions():array; |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get the email-address for the room |
|
65 | - * |
|
66 | - * The email-address has to be globally unique |
|
67 | - * |
|
68 | - * @return string |
|
69 | - * @since 14.0.0 |
|
70 | - */ |
|
71 | - public function getEMail():string; |
|
63 | + /** |
|
64 | + * Get the email-address for the room |
|
65 | + * |
|
66 | + * The email-address has to be globally unique |
|
67 | + * |
|
68 | + * @return string |
|
69 | + * @since 14.0.0 |
|
70 | + */ |
|
71 | + public function getEMail():string; |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get corresponding backend object |
|
75 | - * |
|
76 | - * @return IBackend |
|
77 | - * @since 14.0.0 |
|
78 | - */ |
|
79 | - public function getBackend():IBackend; |
|
73 | + /** |
|
74 | + * Get corresponding backend object |
|
75 | + * |
|
76 | + * @return IBackend |
|
77 | + * @since 14.0.0 |
|
78 | + */ |
|
79 | + public function getBackend():IBackend; |
|
80 | 80 | } |
@@ -35,84 +35,84 @@ |
||
35 | 35 | */ |
36 | 36 | interface IResourceMetadata { |
37 | 37 | |
38 | - /** |
|
39 | - * Type of resource |
|
40 | - * |
|
41 | - * Allowed values for this key include: |
|
42 | - * - projector |
|
43 | - * - tv |
|
44 | - * - vehicle |
|
45 | - * - other |
|
46 | - * |
|
47 | - * @since 17.0.0 |
|
48 | - */ |
|
49 | - public const RESOURCE_TYPE = '{http://nextcloud.com/ns}resource-type'; |
|
38 | + /** |
|
39 | + * Type of resource |
|
40 | + * |
|
41 | + * Allowed values for this key include: |
|
42 | + * - projector |
|
43 | + * - tv |
|
44 | + * - vehicle |
|
45 | + * - other |
|
46 | + * |
|
47 | + * @since 17.0.0 |
|
48 | + */ |
|
49 | + public const RESOURCE_TYPE = '{http://nextcloud.com/ns}resource-type'; |
|
50 | 50 | |
51 | - /** |
|
52 | - * If resource is of type vehicle, this describes the type of vehicle |
|
53 | - * |
|
54 | - * Allowed values: |
|
55 | - * - bicycle |
|
56 | - * - scooter |
|
57 | - * - motorbike |
|
58 | - * - car |
|
59 | - * - plane |
|
60 | - * - helicopter |
|
61 | - * - other |
|
62 | - * |
|
63 | - * @since 17.0.0 |
|
64 | - */ |
|
65 | - public const VEHICLE_TYPE = '{http://nextcloud.com/ns}resource-vehicle-type'; |
|
51 | + /** |
|
52 | + * If resource is of type vehicle, this describes the type of vehicle |
|
53 | + * |
|
54 | + * Allowed values: |
|
55 | + * - bicycle |
|
56 | + * - scooter |
|
57 | + * - motorbike |
|
58 | + * - car |
|
59 | + * - plane |
|
60 | + * - helicopter |
|
61 | + * - other |
|
62 | + * |
|
63 | + * @since 17.0.0 |
|
64 | + */ |
|
65 | + public const VEHICLE_TYPE = '{http://nextcloud.com/ns}resource-vehicle-type'; |
|
66 | 66 | |
67 | - /** |
|
68 | - * Make of the vehicle |
|
69 | - * |
|
70 | - * @since 17.0.0 |
|
71 | - */ |
|
72 | - public const VEHICLE_MAKE = '{http://nextcloud.com/ns}resource-vehicle-make'; |
|
67 | + /** |
|
68 | + * Make of the vehicle |
|
69 | + * |
|
70 | + * @since 17.0.0 |
|
71 | + */ |
|
72 | + public const VEHICLE_MAKE = '{http://nextcloud.com/ns}resource-vehicle-make'; |
|
73 | 73 | |
74 | - /** |
|
75 | - * Model of the vehicle |
|
76 | - * |
|
77 | - * @since 17.0.0 |
|
78 | - */ |
|
79 | - public const VEHICLE_MODEL = '{http://nextcloud.com/ns}resource-vehicle-model'; |
|
74 | + /** |
|
75 | + * Model of the vehicle |
|
76 | + * |
|
77 | + * @since 17.0.0 |
|
78 | + */ |
|
79 | + public const VEHICLE_MODEL = '{http://nextcloud.com/ns}resource-vehicle-model'; |
|
80 | 80 | |
81 | - /** |
|
82 | - * Whether or not the car is electric |
|
83 | - * |
|
84 | - * use '1' for electric, '0' for non-electric |
|
85 | - * |
|
86 | - * @since 17.0.0 |
|
87 | - */ |
|
88 | - public const VEHICLE_IS_ELECTRIC = '{http://nextcloud.com/ns}resource-vehicle-is-electric'; |
|
81 | + /** |
|
82 | + * Whether or not the car is electric |
|
83 | + * |
|
84 | + * use '1' for electric, '0' for non-electric |
|
85 | + * |
|
86 | + * @since 17.0.0 |
|
87 | + */ |
|
88 | + public const VEHICLE_IS_ELECTRIC = '{http://nextcloud.com/ns}resource-vehicle-is-electric'; |
|
89 | 89 | |
90 | - /** |
|
91 | - * Range of vehicle with a full tank |
|
92 | - * |
|
93 | - * @since 17.0.0 |
|
94 | - */ |
|
95 | - public const VEHICLE_RANGE = '{http://nextcloud.com/ns}resource-vehicle-range'; |
|
90 | + /** |
|
91 | + * Range of vehicle with a full tank |
|
92 | + * |
|
93 | + * @since 17.0.0 |
|
94 | + */ |
|
95 | + public const VEHICLE_RANGE = '{http://nextcloud.com/ns}resource-vehicle-range'; |
|
96 | 96 | |
97 | - /** |
|
98 | - * Seating capacity of the vehicle |
|
99 | - * |
|
100 | - * @since 17.0.0 |
|
101 | - */ |
|
102 | - public const VEHICLE_SEATING_CAPACITY = '{http://nextcloud.com/ns}resource-vehicle-seating-capacity'; |
|
97 | + /** |
|
98 | + * Seating capacity of the vehicle |
|
99 | + * |
|
100 | + * @since 17.0.0 |
|
101 | + */ |
|
102 | + public const VEHICLE_SEATING_CAPACITY = '{http://nextcloud.com/ns}resource-vehicle-seating-capacity'; |
|
103 | 103 | |
104 | - /** |
|
105 | - * Contact information about the person who is responsible to administer / maintain this resource |
|
106 | - * This key stores a textual description of name and possible ways to contact the person |
|
107 | - * |
|
108 | - * @since 17.0.0 |
|
109 | - */ |
|
110 | - public const CONTACT_PERSON = '{http://nextcloud.com/ns}resource-contact-person'; |
|
104 | + /** |
|
105 | + * Contact information about the person who is responsible to administer / maintain this resource |
|
106 | + * This key stores a textual description of name and possible ways to contact the person |
|
107 | + * |
|
108 | + * @since 17.0.0 |
|
109 | + */ |
|
110 | + public const CONTACT_PERSON = '{http://nextcloud.com/ns}resource-contact-person'; |
|
111 | 111 | |
112 | - /** |
|
113 | - * Link to the vcard of the contact person |
|
114 | - * |
|
115 | - * @since 17.0.0 |
|
116 | - */ |
|
117 | - public const CONTACT_PERSON_VCARD = '{http://nextcloud.com/ns}resource-contact-person-vcard'; |
|
112 | + /** |
|
113 | + * Link to the vcard of the contact person |
|
114 | + * |
|
115 | + * @since 17.0.0 |
|
116 | + */ |
|
117 | + public const CONTACT_PERSON_VCARD = '{http://nextcloud.com/ns}resource-contact-person-vcard'; |
|
118 | 118 | } |
@@ -33,33 +33,33 @@ |
||
33 | 33 | */ |
34 | 34 | interface IMetadataProvider { |
35 | 35 | |
36 | - /** |
|
37 | - * Get a list of all metadata keys available for this room |
|
38 | - * |
|
39 | - * Room backends are allowed to return custom keys, beyond the ones |
|
40 | - * defined in this class. If they do, they should make sure to use their |
|
41 | - * own namespace. |
|
42 | - * |
|
43 | - * @return String[] - A list of available keys |
|
44 | - * @since 17.0.0 |
|
45 | - */ |
|
46 | - public function getAllAvailableMetadataKeys():array; |
|
36 | + /** |
|
37 | + * Get a list of all metadata keys available for this room |
|
38 | + * |
|
39 | + * Room backends are allowed to return custom keys, beyond the ones |
|
40 | + * defined in this class. If they do, they should make sure to use their |
|
41 | + * own namespace. |
|
42 | + * |
|
43 | + * @return String[] - A list of available keys |
|
44 | + * @since 17.0.0 |
|
45 | + */ |
|
46 | + public function getAllAvailableMetadataKeys():array; |
|
47 | 47 | |
48 | - /** |
|
49 | - * Get whether or not a metadata key is set for this room |
|
50 | - * |
|
51 | - * @param string $key - The key to check for |
|
52 | - * @return bool - Whether or not key is available |
|
53 | - * @since 17.0.0 |
|
54 | - */ |
|
55 | - public function hasMetadataForKey(string $key):bool; |
|
48 | + /** |
|
49 | + * Get whether or not a metadata key is set for this room |
|
50 | + * |
|
51 | + * @param string $key - The key to check for |
|
52 | + * @return bool - Whether or not key is available |
|
53 | + * @since 17.0.0 |
|
54 | + */ |
|
55 | + public function hasMetadataForKey(string $key):bool; |
|
56 | 56 | |
57 | - /** |
|
58 | - * Get the value for a metadata key |
|
59 | - * |
|
60 | - * @param string $key - The key to check for |
|
61 | - * @return string|null - The value stored for the key, null if no value stored |
|
62 | - * @since 17.0.0 |
|
63 | - */ |
|
64 | - public function getMetadataForKey(string $key):?string; |
|
57 | + /** |
|
58 | + * Get the value for a metadata key |
|
59 | + * |
|
60 | + * @param string $key - The key to check for |
|
61 | + * @return string|null - The value stored for the key, null if no value stored |
|
62 | + * @since 17.0.0 |
|
63 | + */ |
|
64 | + public function getMetadataForKey(string $key):?string; |
|
65 | 65 | } |
@@ -38,33 +38,33 @@ |
||
38 | 38 | |
39 | 39 | class FeaturePolicyMiddleware extends Middleware { |
40 | 40 | |
41 | - /** @var FeaturePolicyManager */ |
|
42 | - private $policyManager; |
|
41 | + /** @var FeaturePolicyManager */ |
|
42 | + private $policyManager; |
|
43 | 43 | |
44 | - public function __construct(FeaturePolicyManager $policyManager) { |
|
45 | - $this->policyManager = $policyManager; |
|
46 | - } |
|
44 | + public function __construct(FeaturePolicyManager $policyManager) { |
|
45 | + $this->policyManager = $policyManager; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Performs the default FeaturePolicy modifications that may be injected by other |
|
50 | - * applications |
|
51 | - * |
|
52 | - * @param Controller $controller |
|
53 | - * @param string $methodName |
|
54 | - * @param Response $response |
|
55 | - * @return Response |
|
56 | - */ |
|
57 | - public function afterController($controller, $methodName, Response $response): Response { |
|
58 | - $policy = !is_null($response->getFeaturePolicy()) ? $response->getFeaturePolicy() : new FeaturePolicy(); |
|
48 | + /** |
|
49 | + * Performs the default FeaturePolicy modifications that may be injected by other |
|
50 | + * applications |
|
51 | + * |
|
52 | + * @param Controller $controller |
|
53 | + * @param string $methodName |
|
54 | + * @param Response $response |
|
55 | + * @return Response |
|
56 | + */ |
|
57 | + public function afterController($controller, $methodName, Response $response): Response { |
|
58 | + $policy = !is_null($response->getFeaturePolicy()) ? $response->getFeaturePolicy() : new FeaturePolicy(); |
|
59 | 59 | |
60 | - if (get_class($policy) === EmptyFeaturePolicy::class) { |
|
61 | - return $response; |
|
62 | - } |
|
60 | + if (get_class($policy) === EmptyFeaturePolicy::class) { |
|
61 | + return $response; |
|
62 | + } |
|
63 | 63 | |
64 | - $defaultPolicy = $this->policyManager->getDefaultPolicy(); |
|
65 | - $defaultPolicy = $this->policyManager->mergePolicies($defaultPolicy, $policy); |
|
66 | - $response->setFeaturePolicy($defaultPolicy); |
|
64 | + $defaultPolicy = $this->policyManager->getDefaultPolicy(); |
|
65 | + $defaultPolicy = $this->policyManager->mergePolicies($defaultPolicy, $policy); |
|
66 | + $response->setFeaturePolicy($defaultPolicy); |
|
67 | 67 | |
68 | - return $response; |
|
69 | - } |
|
68 | + return $response; |
|
69 | + } |
|
70 | 70 | } |
@@ -37,147 +37,147 @@ |
||
37 | 37 | */ |
38 | 38 | class EmptyFeaturePolicy { |
39 | 39 | |
40 | - /** @var string[] of allowed domains to autoplay media */ |
|
41 | - protected $autoplayDomains = null; |
|
42 | - |
|
43 | - /** @var string[] of allowed domains that can access the camera */ |
|
44 | - protected $cameraDomains = null; |
|
45 | - |
|
46 | - /** @var string[] of allowed domains that can use fullscreen */ |
|
47 | - protected $fullscreenDomains = null; |
|
48 | - |
|
49 | - /** @var string[] of allowed domains that can use the geolocation of the device */ |
|
50 | - protected $geolocationDomains = null; |
|
51 | - |
|
52 | - /** @var string[] of allowed domains that can use the microphone */ |
|
53 | - protected $microphoneDomains = null; |
|
54 | - |
|
55 | - /** @var string[] of allowed domains that can use the payment API */ |
|
56 | - protected $paymentDomains = null; |
|
57 | - |
|
58 | - /** |
|
59 | - * Allows to use autoplay from a specific domain. Use * to allow from all domains. |
|
60 | - * |
|
61 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
62 | - * @return $this |
|
63 | - * @since 17.0.0 |
|
64 | - */ |
|
65 | - public function addAllowedAutoplayDomain(string $domain): self { |
|
66 | - $this->autoplayDomains[] = $domain; |
|
67 | - return $this; |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * Allows to use the camera on a specific domain. Use * to allow from all domains |
|
72 | - * |
|
73 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
74 | - * @return $this |
|
75 | - * @since 17.0.0 |
|
76 | - */ |
|
77 | - public function addAllowedCameraDomain(string $domain): self { |
|
78 | - $this->cameraDomains[] = $domain; |
|
79 | - return $this; |
|
80 | - } |
|
81 | - |
|
82 | - /** |
|
83 | - * Allows the full screen functionality to be used on a specific domain. Use * to allow from all domains |
|
84 | - * |
|
85 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
86 | - * @return $this |
|
87 | - * @since 17.0.0 |
|
88 | - */ |
|
89 | - public function addAllowedFullScreenDomain(string $domain): self { |
|
90 | - $this->fullscreenDomains[] = $domain; |
|
91 | - return $this; |
|
92 | - } |
|
93 | - |
|
94 | - /** |
|
95 | - * Allows to use the geolocation on a specific domain. Use * to allow from all domains |
|
96 | - * |
|
97 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
98 | - * @return $this |
|
99 | - * @since 17.0.0 |
|
100 | - */ |
|
101 | - public function addAllowedGeoLocationDomain(string $domain): self { |
|
102 | - $this->geolocationDomains[] = $domain; |
|
103 | - return $this; |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * Allows to use the microphone on a specific domain. Use * to allow from all domains |
|
108 | - * |
|
109 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
110 | - * @return $this |
|
111 | - * @since 17.0.0 |
|
112 | - */ |
|
113 | - public function addAllowedMicrophoneDomain(string $domain): self { |
|
114 | - $this->microphoneDomains[] = $domain; |
|
115 | - return $this; |
|
116 | - } |
|
117 | - |
|
118 | - /** |
|
119 | - * Allows to use the payment API on a specific domain. Use * to allow from all domains |
|
120 | - * |
|
121 | - * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
122 | - * @return $this |
|
123 | - * @since 17.0.0 |
|
124 | - */ |
|
125 | - public function addAllowedPaymentDomain(string $domain): self { |
|
126 | - $this->paymentDomains[] = $domain; |
|
127 | - return $this; |
|
128 | - } |
|
129 | - |
|
130 | - /** |
|
131 | - * Get the generated Feature-Policy as a string |
|
132 | - * |
|
133 | - * @return string |
|
134 | - * @since 17.0.0 |
|
135 | - */ |
|
136 | - public function buildPolicy(): string { |
|
137 | - $policy = ''; |
|
138 | - |
|
139 | - if (empty($this->autoplayDomains)) { |
|
140 | - $policy .= "autoplay 'none';"; |
|
141 | - } else { |
|
142 | - $policy .= 'autoplay ' . implode(' ', $this->autoplayDomains); |
|
143 | - $policy .= ';'; |
|
144 | - } |
|
145 | - |
|
146 | - if (empty($this->cameraDomains)) { |
|
147 | - $policy .= "camera 'none';"; |
|
148 | - } else { |
|
149 | - $policy .= 'camera ' . implode(' ', $this->cameraDomains); |
|
150 | - $policy .= ';'; |
|
151 | - } |
|
152 | - |
|
153 | - if (empty($this->fullscreenDomains)) { |
|
154 | - $policy .= "fullscreen 'none';"; |
|
155 | - } else { |
|
156 | - $policy .= 'fullscreen ' . implode(' ', $this->fullscreenDomains); |
|
157 | - $policy .= ';'; |
|
158 | - } |
|
159 | - |
|
160 | - if (empty($this->geolocationDomains)) { |
|
161 | - $policy .= "geolocation 'none';"; |
|
162 | - } else { |
|
163 | - $policy .= 'geolocation ' . implode(' ', $this->geolocationDomains); |
|
164 | - $policy .= ';'; |
|
165 | - } |
|
166 | - |
|
167 | - if (empty($this->microphoneDomains)) { |
|
168 | - $policy .= "microphone 'none';"; |
|
169 | - } else { |
|
170 | - $policy .= 'microphone ' . implode(' ', $this->microphoneDomains); |
|
171 | - $policy .= ';'; |
|
172 | - } |
|
173 | - |
|
174 | - if (empty($this->paymentDomains)) { |
|
175 | - $policy .= "payment 'none';"; |
|
176 | - } else { |
|
177 | - $policy .= 'payment ' . implode(' ', $this->paymentDomains); |
|
178 | - $policy .= ';'; |
|
179 | - } |
|
180 | - |
|
181 | - return rtrim($policy, ';'); |
|
182 | - } |
|
40 | + /** @var string[] of allowed domains to autoplay media */ |
|
41 | + protected $autoplayDomains = null; |
|
42 | + |
|
43 | + /** @var string[] of allowed domains that can access the camera */ |
|
44 | + protected $cameraDomains = null; |
|
45 | + |
|
46 | + /** @var string[] of allowed domains that can use fullscreen */ |
|
47 | + protected $fullscreenDomains = null; |
|
48 | + |
|
49 | + /** @var string[] of allowed domains that can use the geolocation of the device */ |
|
50 | + protected $geolocationDomains = null; |
|
51 | + |
|
52 | + /** @var string[] of allowed domains that can use the microphone */ |
|
53 | + protected $microphoneDomains = null; |
|
54 | + |
|
55 | + /** @var string[] of allowed domains that can use the payment API */ |
|
56 | + protected $paymentDomains = null; |
|
57 | + |
|
58 | + /** |
|
59 | + * Allows to use autoplay from a specific domain. Use * to allow from all domains. |
|
60 | + * |
|
61 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
62 | + * @return $this |
|
63 | + * @since 17.0.0 |
|
64 | + */ |
|
65 | + public function addAllowedAutoplayDomain(string $domain): self { |
|
66 | + $this->autoplayDomains[] = $domain; |
|
67 | + return $this; |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * Allows to use the camera on a specific domain. Use * to allow from all domains |
|
72 | + * |
|
73 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
74 | + * @return $this |
|
75 | + * @since 17.0.0 |
|
76 | + */ |
|
77 | + public function addAllowedCameraDomain(string $domain): self { |
|
78 | + $this->cameraDomains[] = $domain; |
|
79 | + return $this; |
|
80 | + } |
|
81 | + |
|
82 | + /** |
|
83 | + * Allows the full screen functionality to be used on a specific domain. Use * to allow from all domains |
|
84 | + * |
|
85 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
86 | + * @return $this |
|
87 | + * @since 17.0.0 |
|
88 | + */ |
|
89 | + public function addAllowedFullScreenDomain(string $domain): self { |
|
90 | + $this->fullscreenDomains[] = $domain; |
|
91 | + return $this; |
|
92 | + } |
|
93 | + |
|
94 | + /** |
|
95 | + * Allows to use the geolocation on a specific domain. Use * to allow from all domains |
|
96 | + * |
|
97 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
98 | + * @return $this |
|
99 | + * @since 17.0.0 |
|
100 | + */ |
|
101 | + public function addAllowedGeoLocationDomain(string $domain): self { |
|
102 | + $this->geolocationDomains[] = $domain; |
|
103 | + return $this; |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * Allows to use the microphone on a specific domain. Use * to allow from all domains |
|
108 | + * |
|
109 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
110 | + * @return $this |
|
111 | + * @since 17.0.0 |
|
112 | + */ |
|
113 | + public function addAllowedMicrophoneDomain(string $domain): self { |
|
114 | + $this->microphoneDomains[] = $domain; |
|
115 | + return $this; |
|
116 | + } |
|
117 | + |
|
118 | + /** |
|
119 | + * Allows to use the payment API on a specific domain. Use * to allow from all domains |
|
120 | + * |
|
121 | + * @param string $domain Domain to whitelist. Any passed value needs to be properly sanitized. |
|
122 | + * @return $this |
|
123 | + * @since 17.0.0 |
|
124 | + */ |
|
125 | + public function addAllowedPaymentDomain(string $domain): self { |
|
126 | + $this->paymentDomains[] = $domain; |
|
127 | + return $this; |
|
128 | + } |
|
129 | + |
|
130 | + /** |
|
131 | + * Get the generated Feature-Policy as a string |
|
132 | + * |
|
133 | + * @return string |
|
134 | + * @since 17.0.0 |
|
135 | + */ |
|
136 | + public function buildPolicy(): string { |
|
137 | + $policy = ''; |
|
138 | + |
|
139 | + if (empty($this->autoplayDomains)) { |
|
140 | + $policy .= "autoplay 'none';"; |
|
141 | + } else { |
|
142 | + $policy .= 'autoplay ' . implode(' ', $this->autoplayDomains); |
|
143 | + $policy .= ';'; |
|
144 | + } |
|
145 | + |
|
146 | + if (empty($this->cameraDomains)) { |
|
147 | + $policy .= "camera 'none';"; |
|
148 | + } else { |
|
149 | + $policy .= 'camera ' . implode(' ', $this->cameraDomains); |
|
150 | + $policy .= ';'; |
|
151 | + } |
|
152 | + |
|
153 | + if (empty($this->fullscreenDomains)) { |
|
154 | + $policy .= "fullscreen 'none';"; |
|
155 | + } else { |
|
156 | + $policy .= 'fullscreen ' . implode(' ', $this->fullscreenDomains); |
|
157 | + $policy .= ';'; |
|
158 | + } |
|
159 | + |
|
160 | + if (empty($this->geolocationDomains)) { |
|
161 | + $policy .= "geolocation 'none';"; |
|
162 | + } else { |
|
163 | + $policy .= 'geolocation ' . implode(' ', $this->geolocationDomains); |
|
164 | + $policy .= ';'; |
|
165 | + } |
|
166 | + |
|
167 | + if (empty($this->microphoneDomains)) { |
|
168 | + $policy .= "microphone 'none';"; |
|
169 | + } else { |
|
170 | + $policy .= 'microphone ' . implode(' ', $this->microphoneDomains); |
|
171 | + $policy .= ';'; |
|
172 | + } |
|
173 | + |
|
174 | + if (empty($this->paymentDomains)) { |
|
175 | + $policy .= "payment 'none';"; |
|
176 | + } else { |
|
177 | + $policy .= 'payment ' . implode(' ', $this->paymentDomains); |
|
178 | + $policy .= ';'; |
|
179 | + } |
|
180 | + |
|
181 | + return rtrim($policy, ';'); |
|
182 | + } |
|
183 | 183 | } |
@@ -37,23 +37,23 @@ |
||
37 | 37 | * @since 17.0.0 |
38 | 38 | */ |
39 | 39 | class FeaturePolicy extends EmptyFeaturePolicy { |
40 | - protected $autoplayDomains = [ |
|
41 | - '\'self\'', |
|
42 | - ]; |
|
40 | + protected $autoplayDomains = [ |
|
41 | + '\'self\'', |
|
42 | + ]; |
|
43 | 43 | |
44 | - /** @var string[] of allowed domains that can access the camera */ |
|
45 | - protected $cameraDomains = []; |
|
44 | + /** @var string[] of allowed domains that can access the camera */ |
|
45 | + protected $cameraDomains = []; |
|
46 | 46 | |
47 | - protected $fullscreenDomains = [ |
|
48 | - '\'self\'', |
|
49 | - ]; |
|
47 | + protected $fullscreenDomains = [ |
|
48 | + '\'self\'', |
|
49 | + ]; |
|
50 | 50 | |
51 | - /** @var string[] of allowed domains that can use the geolocation of the device */ |
|
52 | - protected $geolocationDomains = []; |
|
51 | + /** @var string[] of allowed domains that can use the geolocation of the device */ |
|
52 | + protected $geolocationDomains = []; |
|
53 | 53 | |
54 | - /** @var string[] of allowed domains that can use the microphone */ |
|
55 | - protected $microphoneDomains = []; |
|
54 | + /** @var string[] of allowed domains that can use the microphone */ |
|
55 | + protected $microphoneDomains = []; |
|
56 | 56 | |
57 | - /** @var string[] of allowed domains that can use the payment API */ |
|
58 | - protected $paymentDomains = []; |
|
57 | + /** @var string[] of allowed domains that can use the payment API */ |
|
58 | + protected $paymentDomains = []; |
|
59 | 59 | } |
@@ -36,16 +36,16 @@ |
||
36 | 36 | */ |
37 | 37 | class Proxy extends Entity { |
38 | 38 | |
39 | - /** @var string */ |
|
40 | - protected $ownerId; |
|
41 | - /** @var string */ |
|
42 | - protected $proxyId; |
|
43 | - /** @var int */ |
|
44 | - protected $permissions; |
|
39 | + /** @var string */ |
|
40 | + protected $ownerId; |
|
41 | + /** @var string */ |
|
42 | + protected $proxyId; |
|
43 | + /** @var int */ |
|
44 | + protected $permissions; |
|
45 | 45 | |
46 | - public function __construct() { |
|
47 | - $this->addType('ownerId', 'string'); |
|
48 | - $this->addType('proxyId', 'string'); |
|
49 | - $this->addType('permissions', 'int'); |
|
50 | - } |
|
46 | + public function __construct() { |
|
47 | + $this->addType('ownerId', 'string'); |
|
48 | + $this->addType('proxyId', 'string'); |
|
49 | + $this->addType('permissions', 'int'); |
|
50 | + } |
|
51 | 51 | } |