Hi all,
We ran into these limitations of HTTP-Upload in Xabber some time ago and built a media service that already supports uploads, file listing and deletion, per-user quotas, avatars, and thumbnails. We’ve now published it under AGPL-3.0:
We deliberately moved file management out of XMPP. Since file transfers already happen over HTTP, we saw little benefit in routing their management through XMPP as well. We use XMPP to verify account ownership; the client then manages files directly through an authenticated HTTP API. Shared file URLs still travel in ordinary XMPP messages.
Authentication works as follows:
The client requests a code over HTTP, specifying its connected full JID:
POST /api/v1/account/xmpp_code_request/
Content-Type: application/json
{"jid":"alice@example.com/desktop","type":"iq"}The gallery sends that resource an XMPP IQ containing:
<confirm xmlns="http://jabber.org/protocol/http-auth"
id="123456" url="…"/>The client exchanges the code over HTTP, using its bare JID:
POST /api/v1/account/xmpp_auth/
Content-Type: application/json
{"jid":"alice@example.com","code":123456}The response contains a bearer token and its expiration timestamp. Subsequent API requests use Authorization: Bearer <token>.
The main API methods are:
GET /api/v1/files/ — list uploaded files.POST /api/v1/files/upload/ — upload a file.DELETE /api/v1/files/ — delete files by ID, URL, or selection filters.GET /api/v1/files/slot/ — check quota and reuse existing content through deduplication.GET /api/v1/files/stats/ — retrieve storage usage.Another device can authenticate independently, list the same account’s uploads, and delete them without retaining secrets from the original upload.
This uses our own API rather than XEP-0363 or XEP-0498. Anyone interested can deploy the service and integrate their client; installation instructions and the client protocol are documented in the repository.
> have this feature added directly to stable and bypass completely the specification workflow?
I think no set of rules are bulletproof, and it is fine to deviate
sometimes when it is reasonable and consensual. I have no strong opinion
about the deletion feature, it seems trivial and fine as it is, but I am
not particularly good at predicting future potential issues, edge cases
and whatnot.
> Do you think that having it as a separate XEP is a problem ?
It is already pretty challenging to know which XEPs are relevant and how
to use them regarding message attachments, and this would make it
slightly worse. Not the end of the world though.
All in all, I don't care much either way, which would normally have
prevented me to post in this thread, but you asked for it Goffi, so here
we go. :o)
Best,
-- nicoco
_______________________________________________
Standards mailing list -- standards@xmpp.org
To unsubscribe send an email to standards-leave@xmpp.org