Skip to content

Commit

Permalink
Signed-off-by: tooptoop4 <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
tooptoop4 authored Nov 6, 2024
1 parent 4742e9d commit d7b3f5d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/artifacts/artifact_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func (a *ArtifactServer) GetArtifactFile(w http.ResponseWriter, r *http.Request)
a.serverInternalError(err, w)
return
}

if wf == nil {
a.httpBadRequestError(w)
return
}
case "archived-workflows":
uid := id
log.WithFields(log.Fields{"namespace": namespace, "uid": uid, "nodeId": nodeId, "artifactName": artifactName}).Info("Get artifact file")
Expand All @@ -137,6 +142,11 @@ func (a *ArtifactServer) GetArtifactFile(w http.ResponseWriter, r *http.Request)
return
}

if wf == nil {
a.httpBadRequestError(w)
return
}

// check that the namespace passed in matches this workflow's namespace
if wf.GetNamespace() != namespace {
a.httpBadRequestError(w)
Expand Down Expand Up @@ -266,6 +276,10 @@ func (a *ArtifactServer) getArtifact(w http.ResponseWriter, r *http.Request, isI
a.httpFromError(err, w)
return
}
if wf == nil {
a.httpBadRequestError(w)
return
}
art, driver, err := a.getArtifactAndDriver(ctx, nodeId, artifactName, isInput, wf, nil)
if err != nil {
a.serverInternalError(err, w)
Expand Down Expand Up @@ -305,6 +319,11 @@ func (a *ArtifactServer) getArtifactByUID(w http.ResponseWriter, r *http.Request
return
}

if wf == nil {
a.httpBadRequestError(w)
return
}

ctx, err := a.gateKeeping(r, types.NamespaceHolder(wf.GetNamespace()))
if err != nil {
a.unauthorizedError(w)
Expand Down

0 comments on commit d7b3f5d

Please sign in to comment.