Not sending auth key in webhook callbacks anymore

This commit is contained in:
frikky
2022-04-11 16:56:34 +02:00
parent e49e151048
commit a42e815fd4
2 changed files with 12 additions and 10 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ require (
github.com/h2non/filetype v1.1.3
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.2.27
github.com/shuffle/shuffle-shared v0.2.28
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
google.golang.org/api v0.65.0
+11 -9
View File
@@ -2247,7 +2247,7 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) {
*/
resp.WriteHeader(200)
resp.Write([]byte(fmt.Sprintf(`{"success": true, "execution_id": "%s", "authorization": "%s"}`, workflowExecution.ExecutionId, workflowExecution.Authorization)))
resp.Write([]byte(fmt.Sprintf(`{"success": true, "execution_id": "%s"}`, workflowExecution.ExecutionId)))
return
}
@@ -3237,14 +3237,6 @@ func buildSwaggerApp(resp http.ResponseWriter, body []byte, user shuffle.User) {
fmt.Sprintf("%s:%s", baseDockerName, versionName),
}
err = buildImage(dockerTags, dockerLocation)
if err != nil {
log.Printf("[ERROR] Docker build error: %s", err)
resp.WriteHeader(500)
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Error in Docker build: %s"}`, err)))
return
}
found := false
foundNumber := 0
log.Printf("[INFO] Checking for api with ID %s", newmd5)
@@ -3328,6 +3320,16 @@ func buildSwaggerApp(resp http.ResponseWriter, body []byte, user shuffle.User) {
shuffle.DeleteCache(ctx, cacheKey)
shuffle.DeleteCache(ctx, fmt.Sprintf("apps_%s", user.Id))
// Doing this last to ensure we can copy the docker image over
// even though builds fail
err = buildImage(dockerTags, dockerLocation)
if err != nil {
log.Printf("[ERROR] Docker build error: %s", err)
resp.WriteHeader(500)
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Error in Docker build: %s"}`, err)))
return
}
log.Printf("[DEBUG] Successfully built app %s (%s)", api.Name, api.ID)
if len(user.Id) > 0 {
resp.WriteHeader(200)