添加S3策略的支持 (#425)

* 添加亚马逊S3策略的支持

* 添加CDN支持,公有目录删除无用参数

* 增加Region
This commit is contained in:
ZZF
2020-06-05 14:45:24 +08:00
committed by GitHub
parent 27bf8ca9b2
commit dd50ef1c25
10 changed files with 611 additions and 22 deletions

View File

@@ -1,12 +1,13 @@
package controllers
import (
"net/url"
"strconv"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/pkg/util"
"github.com/HFO4/cloudreve/service/callback"
"github.com/gin-gonic/gin"
"net/url"
"strconv"
)
// RemoteCallback 远程上传回调
@@ -106,3 +107,14 @@ func COSCallback(c *gin.Context) {
c.JSON(200, ErrorResponse(err))
}
}
// S3Callback S3上传完成客户端回调
func S3Callback(c *gin.Context) {
var callbackBody callback.S3Callback
if err := c.ShouldBindQuery(&callbackBody); err == nil {
res := callbackBody.PreProcess(c)
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}