Feat: onedrive client upload / callback

This commit is contained in:
HFO4
2020-01-20 14:34:21 +08:00
parent 807aa5ac18
commit dd5f6e3d25
10 changed files with 359 additions and 35 deletions

View File

@ -273,3 +273,19 @@ func UpyunCallbackAuth() gin.HandlerFunc {
c.Next()
}
}
// OneDriveCallbackAuth OneDrive回调签名验证
// TODO 解耦
func OneDriveCallbackAuth() gin.HandlerFunc {
return func(c *gin.Context) {
// 验证key并查找用户
resp, _ := uploadCallbackCheck(c)
if resp.Code != 0 {
c.JSON(401, serializer.QiniuCallbackFailed{Error: resp.Msg})
c.Abort()
return
}
c.Next()
}
}