Skip to content

feat(graph): add metadata API for custom xattrs (GET + PUT)#2960

Open
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/metadata-api
Open

feat(graph): add metadata API for custom xattrs (GET + PUT)#2960
flash7777 wants to merge 1 commit into
opencloud-eu:mainfrom
flash7777:feature/metadata-api

Conversation

@flash7777

Copy link
Copy Markdown

Summary

  • GET /graph/v1beta1/drives/{driveID}/items/{itemID}/metadata β€” returns all custom metadata (user.oc.md.*) as JSON
  • PUT /graph/v1beta1/drives/{driveID}/items/{itemID}/metadata β€” sets metadata from JSON body, keys map to user.oc.md.{key} xattrs

This enables client-side features like notes, classifications, or any custom properties without requiring WebDAV PROPPATCH (which has namespace/key mapping issues for oc: properties).

Test plan

  • Upload a file, PUT {"note": "test"} to metadata endpoint, verify xattr user.oc.md.note is set
  • GET metadata endpoint, verify {"note": "test"} is returned
  • Test with special characters (umlauts, CJK, emoji)
  • Verify permission check (only users with upload permission can set metadata)

πŸ€– Generated with Claude Code

Add endpoints to read and write arbitrary metadata (user.oc.md.*)
on drive items via the Graph API:

- GET  /drives/{driveID}/items/{itemID}/metadata
  Returns all custom metadata as JSON key-value pairs.

- PUT  /drives/{driveID}/items/{itemID}/metadata
  Sets metadata from a JSON body. Keys map to user.oc.md.{key} xattrs.

This enables client-side features like notes, classifications, or
any custom properties without requiring WebDAV PROPPATCH (which has
namespace/key mapping issues for oc: properties).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards βœ…

🟒 Issues 0 issues

Results:
0 new issues

View in Codacy

🟒 Metrics 20 complexity · 4 duplication

Metric Results
Complexity 20
Duplication 4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant