From: Jerome Jutteau Date: Sun, 28 Jun 2015 22:58:08 +0000 (+0200) Subject: add an alias system to the API. X-Git-Tag: 1.1~54^2 X-Git-Url: https://git.p6c8.net/jirafeau.git/commitdiff_plain/d98c495abf51c2581b2d8b1edfc09004f5defcde?ds=inline;hp=d98c495abf51c2581b2d8b1edfc09004f5defcde add an alias system to the API. This alias system permits to create an "alias" to an uploaded file. This permits to upload some new content and update the alias to the new content. This will permits to implement a lot of services, for example: - Storing a live chat between two people - Update a list of files - Put a whole website and update it A few notes: - An alias MUST point to an existing upload at his creation or update. - Alias are not protected against reading but are protected against updates and deletion using a password. The destination of the alias can still be protected by a password. - Alias can be updated to change it's target and/or change the password. - Alias names and passwords must be between 8 and 32 characters. Some examples: - Create an alias: curl -X POST \ --http1.0 \ -F "alias=my-awsome-alias" \ -F "destination=13dA8apU" \ -F "password=my-very-secret-password" \ http://my-host/jirafeau/script.php?alias_create=1 => OK - Get an alias curl -X POST \ --http1.0 \ -F "alias=my-awsome-alias" \ http://my-host/jirafeau/script.php?alias_get=1 => 13dA8apU - Update an alias: curl -X POST \ --http1.0 \ -F "alias=my-awsome-alias" \ -F "destination=2Ab6f17o" \ -F "password=my-new-password" \ http://my-host/jirafeau/script.php?alias_update=1 => OK - Access to alias using the web interface, let's go to: http://couak.net/jirafeau-dev/f.php?h=my-awsome-alias - Delete an alias: curl -X POST \ --http1.0 \ -F "alias=my-awsome-alias" \ -F "password=my-new-password" \ http://my-host/jirafeau/script.php?alias_delete=1 => OK Signed-off-by: Jerome Jutteau ---