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
+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)