Validate published output declarations
This commit is contained in:
@@ -182,12 +182,11 @@ func restoreLocalRelativePathForCommittedArtifact(sessionPrefix string, artifact
|
||||
if artifact.Type != artifacts.RemoteArtifactTypePublishedOutput {
|
||||
return "", false, nil
|
||||
}
|
||||
identity, err := artifacts.ParseImmutableRunObjectKey(sessionPrefix, artifact.DestinationKey)
|
||||
identity, err := artifacts.ParsePublishedOutputObjectKey(sessionPrefix, artifact.DestinationKey)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
rel := strings.TrimPrefix(identity.RelativePath, "published/")
|
||||
cleanRel, err := pathsafe.NormalizeRelativeDestination(rel)
|
||||
cleanRel, err := pathsafe.NormalizeRelativeDestination(identity.Destination)
|
||||
if err != nil {
|
||||
return "", false, fmt.Errorf("committed destination is unsafe: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user