MCPcopy Index your code
hub / github.com/SignTools/SignTools / uploadSignedApp

Function uploadSignedApp

main.go:375–401  ·  view source on GitHub ↗
(c echo.Context, job *storage.ReturnJob)

Source from the content-addressed store, hash-verified

373}
374
375func uploadSignedApp(c echo.Context, job *storage.ReturnJob) error {
376 app, ok := storage.Apps.Get(job.AppId)
377 if !ok {
378 return errors.New(fmt.Sprintf("return job %s appid %s not resolved", job.Id, job.AppId))
379 }
380 fileId := c.FormValue(formNames.FormFileId)
381 upload, ok := storage.Uploads.Get(fileId)
382 if !ok {
383 return errors.New("no app upload file with id " + fileId)
384 }
385 defer storage.Uploads.Delete(fileId)
386 file, err := upload.GetData()
387 if err != nil {
388 return err
389 }
390 defer file.Close()
391 if err := app.SetFile(storage.AppSignedFile, file); err != nil {
392 return err
393 }
394 if err := app.SetString(storage.AppBundleId, c.FormValue("bundle_id")); err != nil {
395 return err
396 }
397 if !storage.Jobs.DeleteById(job.Id) {
398 return errors.New("unable to delete return job " + job.Id)
399 }
400 return c.NoContent(200)
401}
402
403func get2FA(c echo.Context, job *storage.ReturnJob) error {
404 code := job.TwoFactorCode.Load()

Callers

nothing calls this directly

Calls 7

NewMethod · 0.80
DeleteByIdMethod · 0.80
GetDataMethod · 0.65
SetFileMethod · 0.65
SetStringMethod · 0.65
GetMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected