2019-01-09 15:58:42 +08:00

94 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ufile SDK remote Auth-Server
## 说明
- 该项目用于Ufile SDK接入远端签名时使用
- 您需要clone对应语言的源码在项目中配置public key和private key避免了部分平台的SDK特别是android和iOS平台会将private key放在本地的不安全性。
## 接口说明
#### 请求对象操作的API签名
- **URL**: http://your_domain/applyAuth
- **http method**: POST
- **Content-Type**: application/json
- **Request Body**:
``` java
{
/**
* Required
* 你请求的Ufile API的Http Method
*/
"method":"PUT",
/**
* Required
* 你想操作的Bucket名称
*/
"bucket":"bucketName",
/**
* Optional
* 你想操作的云端对象的名称
*/
"key":"object's key name"
/**
* Optional
* 你请求Ufile API时的Content-Type
*/
"content_type":"application/octet-stream",
/**
* Optional
* 你在请求上传类Ufile API时的数据的MD5
*/
"content_md5":"",
/**
* Optional
* 你请求的时间字符串格式yyyyMMddHHmmss
*/
"date":"yyyyMMddHHmmss"
/**
* Optional
* 签名服务额外可选参数你可以将你部署的签名服务API的鉴权数据放在该字段部分语言版本的Ufile SDK可配置签名额外参数。
* 格式Json字符串注意Json中引号需要转义
*/
"optional":"{\"your optional data json\":\"This is your data value\"}"
}
```
- **Response Body**: 签名结果字符串
#### 请求私有Bucket的对象下载链接签名
- **URL**: http://your_domain/applyPrivateUrlAuth
- **http method**: POST
- **Content-Type**: application/json
- **Request Body**:
``` java
{
/**
* Required
* 你请求的Ufile API的Http Method
*/
"method":"GET",
/**
* Required
* 你想操作的Bucket名称
*/
"bucket":"bucketName",
/**
* Required
* 你想操作的云端对象的名称
*/
"key":"object's key name"
/**
* Required
* 私有Bucket的Object的下载链接的失效时间
* 失效时间: 当前时间加上一个有效时间, 单位Unix time second
*/
"expires":123456789,
/**
* Optional
* 签名服务额外可选参数你可以将你部署的签名服务API的鉴权数据放在该字段部分语言版本的Ufile SDK可配置签名额外参数。
* 格式Json字符串注意Json中引号需要转义
*/
"optional":"{\"your optional data json\":\"This is your data value\"}"
}
```
- **Response Body**: 签名结果字符串