Feat: auth for remote callback / Modify: use map to store hooks in filesystem

This commit is contained in:
HFO4
2019-12-30 19:08:38 +08:00
parent ca9f44c06c
commit d29b7ef6f8
15 changed files with 158 additions and 59 deletions

View File

@@ -57,7 +57,7 @@ func (handler Handler) Source(
func (handler Handler) Token(ctx context.Context, TTL int64, key string) (serializer.UploadCredential, error) {
// 生成回调地址
siteURL := model.GetSiteURL()
apiBaseURI, _ := url.Parse("/api/v3/callback/upload/" + key)
apiBaseURI, _ := url.Parse("/api/v3/callback/remote/" + key)
apiURL := siteURL.ResolveReference(apiBaseURI)
// 生成上传策略