MCPcopy Create free account
hub / github.com/MG-RAST/Shock / PreAuthRequest

Function PreAuthRequest

shock-server/controller/preauth/preauth.go:19–35  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

17)
18
19func PreAuthRequest(ctx context.Context) {
20 id := ctx.PathValue("id")
21 if p, err := preauth.Load(id); err != nil {
22 err_msg := "err:@preAuth load: " + err.Error()
23 logger.Error(err_msg)
24 responder.RespondWithError(ctx, http.StatusInternalServerError, err_msg)
25 } else {
26 switch p.Type {
27 case "download":
28 streamDownload(ctx, id, p.Nodes, p.Options)
29 preauth.Delete(id)
30 default:
31 responder.RespondWithError(ctx, http.StatusNotFound, "Preauthorization type not supported: "+p.Type)
32 }
33 }
34 return
35}
36
37// handle download and its options
38func streamDownload(ctx context.Context, pid string, nodes []string, options map[string]string) {

Callers

nothing calls this directly

Calls 4

streamDownloadFunction · 0.85
LoadMethod · 0.80
ErrorMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected