Skip to content

support magic folder ids in the remaining endpoints #4925

Description

@shepilov

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions