mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
manifest inspect: support authentication
Previous tests have worked by pure chance since the client and server ran on the same host; the server picked up the credentials created by the client login. Extend the gating tests and add a new integration test which is further capable of exercising the remote code. Note that fixing authentication support requires adding a new `--authfile` CLi flag to `manifest inspect`. This will at least allow for passing an authfile to be bindings. Username and password are not yet supported. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@@ -153,12 +153,19 @@ func ManifestInspect(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
imageEngine := abi.ImageEngine{Libpod: runtime}
|
||||
opts := entities.ManifestInspectOptions{}
|
||||
_, authfile, err := auth.GetCredentials(r)
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusBadRequest, err)
|
||||
return
|
||||
}
|
||||
defer auth.RemoveAuthfile(authfile)
|
||||
|
||||
opts := entities.ManifestInspectOptions{Authfile: authfile}
|
||||
if _, found := r.URL.Query()["tlsVerify"]; found {
|
||||
opts.SkipTLSVerify = types.NewOptionalBool(!query.TLSVerify)
|
||||
}
|
||||
|
||||
imageEngine := abi.ImageEngine{Libpod: runtime}
|
||||
rawManifest, err := imageEngine.ManifestInspect(r.Context(), name, opts)
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusNotFound, err)
|
||||
|
||||
Reference in New Issue
Block a user