mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-20 11:30:38 -06:00
We agreed to move the 'opencloud_full' example to a new directory to avoid confusion with the supported compose examples in opencloud-compose. This commit keeps the bare-metal example in place as that is still mentioned in the documentation.
34 lines
732 B
Rego
34 lines
732 B
Rego
package proxy
|
|
|
|
import future.keywords.if
|
|
import data.utils
|
|
|
|
default granted := true
|
|
|
|
granted = false if {
|
|
input.request.method == "PUT"
|
|
pathPrefixes := [
|
|
"/dav",
|
|
"/remote.php/webdav",
|
|
"/remote.php/dav",
|
|
"/webdav",
|
|
]
|
|
restricted := pathPrefixes[_]
|
|
startswith(input.request.path, restricted)
|
|
not utils.is_extension_allowed(input.resource.name)
|
|
}
|
|
|
|
granted = false if {
|
|
input.request.method == "POST"
|
|
pathPrefixes := [
|
|
"/data",
|
|
"/dav",
|
|
"/remote.php/webdav",
|
|
"/remote.php/dav",
|
|
"/webdav",
|
|
]
|
|
restricted := pathPrefixes[_]
|
|
startswith(input.request.path, restricted)
|
|
not utils.is_extension_allowed(input.resource.name)
|
|
}
|