Hi All,

The Image Service API [1] was designed to provide the capability to upload
 an image to user profile, service provider and identity provider in WSO2
Identity Server. As the next phase, we have decided to generalize the Image
Service API as Media Service API so as to give the flexibility to perform
file uploads and downloads of different types.

The file uploading API (POST) will have the URL format as

*api/server/v1/media/ *

with the content-type as Multipart JSON and Octet Stream. This API will
allow users to perform a single upload to persist both the file and the
associated metadata information on the file. Metadata information such as
file name, file type, visibility permissions etc. will be passed as
key-value pairs and will be persisted as a JSON file in the same location
in the file system where the actual resource is saved. The reason to
persist metadata in the file system rather than in the database is to
prevent additional database calls which can have a performance impact.

The file download API (GET) will have the following URL format.

*api/server/v1/media/{id}/data*


As of now, we have identified several use-cases in the identity server that
requires to save CSS files and image files with this API. Therefore we will
be providing the uploading capability only for these file formats. The
reason for this is to prevent file uploads of malicious executable files. If
a user requires to upload a different file (ex: pdf) we will provide a
configuration so that the user has the flexibility to add new file types
depending on the requirement.

In the future, we can have a separate API as *api/server/v1/media**/{id}/meta
*for the purpose of metadata retrieval.

Highly appreciate any thoughts and feedback on this.

[1] "Image Service to Upload/Download Images in Identity Server"

Thanks,
Dewni
-- 
Dewni Weeraman | Software Engineer | WSO2 Inc.
(m) +94 077 2979049 | (e) de...@wso2.com <nipu...@wso2.com>

<http://wso2.com/signature>
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to