Follow-up to #4921.
Use Instance.ResolveDirID wherever an API accepts a directory ID. The first changes cover file/folder creation, metadata, contents, and size under /files.
What's left
- Copy: resolve the
DirID query parameter.
- PATCH and batch PATCH: resolve source IDs and parent IDs (
dir_id or the parent relationship).
- Other folder routes: HEAD, trash/delete, restore, and reference/sync settings. Decide how aliases should work for trash and restore; don't restore old contents just to resolve an ID.
- Archives and bulk requests: resolve directory IDs before checking permissions or saving the request.
- Notes: resolve an explicit
dir_id in POST /notes. The default Notes folder already uses the resolver.
- Shared drives: resolve path IDs, copy destinations, PATCH parents, and share/permission folder targets on the owner's instance, before access checks. Keep encoded slashes intact when proxying. Test both local and remote owners.
- Moves between drives: resolve
source.dir_id and dest.dir_id on their respective instances.
Keep the same rules: authenticate first, allow missing magic folders to be created, then check permissions for the actual operation. Store real directory IDs. Leave normal IDs and application references unchanged.
Reuse the resolver; don't add folder creation to VFS getters. Add tests and update the docs as each endpoint is wired up.
Follow-up to #4921.
Use
Instance.ResolveDirIDwherever an API accepts a directory ID. The first changes cover file/folder creation, metadata, contents, and size under/files.What's left
DirIDquery parameter.dir_idor theparentrelationship).dir_idinPOST /notes. The default Notes folder already uses the resolver.source.dir_idanddest.dir_idon their respective instances.Keep the same rules: authenticate first, allow missing magic folders to be created, then check permissions for the actual operation. Store real directory IDs. Leave normal IDs and application references unchanged.
Reuse the resolver; don't add folder creation to VFS getters. Add tests and update the docs as each endpoint is wired up.