MCPcopy
hub / github.com/harness/harness / StoreArtifactInfo

Function StoreArtifactInfo

registry/app/api/middleware/artifact_info.go:26–41  ·  view source on GitHub ↗

StoreArtifactInfo stores the Base Artifact Info for any package type.

(
	provider pkg.ArtifactInfoProvider,
)

Source from the content-addressed store, hash-verified

24
25// StoreArtifactInfo stores the Base Artifact Info for any package type.
26func StoreArtifactInfo(
27 provider pkg.ArtifactInfoProvider,
28) func(next http.Handler) http.Handler {
29 return func(next http.Handler) http.Handler {
30 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
31 packageInfo, err := provider.GetPackageArtifactInfo(r)
32 if err != nil {
33 render.TranslatedUserError(r.Context(), w, err)
34 return
35 }
36 // Store the base artifact info in the context
37 ctx := request.WithArtifactInfo(r.Context(), packageInfo)
38 next.ServeHTTP(w, r.WithContext(ctx))
39 })
40 }
41}

Callers 3

NewRouterFunction · 0.92
registerDistTagRoutesFunction · 0.92
registerRevisionRoutesFunction · 0.92

Calls 4

TranslatedUserErrorFunction · 0.92
WithArtifactInfoFunction · 0.92
ServeHTTPMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…