Enabling file uploads and file deletions
WebDav Operations
Preliminaries
The server can be configured to allow static file updates using the WebDav protocol.
When used with WebDAV software, the server will adhere to special rules for PUT and DELETE methods.
To enable this functionality, turn on the WebDav module.
The RBAC module is used to grant or deny permission to PUT and DELETE static files. If the RBAC module is not on, the request will fail.
Cookbook
Example: Enabling WebDAV PUT and DELETE through RBAC
host {
modules {
web-dav on
rbac on
}
plugins {
router {
`/login-logout/*` *methods=POST *plugin='rwserve-rbac-auth'
}
}
rbac {
roles `/etc/rwserve/roles` // the file created by the 'addrole' CLI utility
cipher-secret C#9fB$2gD@5zR*7e // secret used to encrypt the 'rw-roles' cookie
max-idle 1800 // number of seconds of inactivity before credentials expire
resources {
`/login-logout/*` *methods=POST *roles=anonymous
`*` *methods=GET,HEAD *roles=anonymous
`*` *methods=PUT,DELETE *roles=devops
}
}
}
In-depth reading
RBAC
Using role based access controls to restrict resource usage
This note describes the Role Based Access Control (RBAC) mechanism of the server. Access to resources are allowed or denied based on resource patterns and request methods matched against user-assigned roles.
RBAC, Role Based Access Control, roles, allow, deny, anonymous, rw-rbac-no-matching-role, rw-rbac-no-resource-rule, cipher-secret, max-idle
PUT Method
Uploading files to the server
This note provides supplementary information about the server's implementation of the standard HTTP PUT method to create and update an entire resource.
RWSERVE, PUT method, WebDAV, AJAX, upload, create, update, rw-path, rw-content-type-missing, rw-content-type-not-supported, rw-content-type-mismatch, rw-content-length-missing, rw-content-length-limit, rw-if-unmodified-since, rw-if-match, rw-if-none-match, rw-content-decoding, rw-content-range, 201, 204, 406, 411, 412, 415, 501, IETF RFC 7231
DELETE Method
Side effects when deleting files from the server
This note provides supplementary information about the server's implementation of the standard HTTP DELETE method and its side effects.
RWSERVE, DELETE method, side effects, WebDAV, AJAX, rw-request-file-deleted, rw-request-dir-deleted, rw-blue-file-deleted, rw-blue-map-deleted, rw-blue-dir-deleted, rw-encoding-file-deleted, rw-encoding-dir-deleted, rw-request-file-not-deleted, 204, 409, IETF RFC 7231