You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a machine without credentials store, after docker login docker.io succeeds, notation login with the same credential should also succeed with a warning.
However, it fails to detect the existing credential and throws an error:
// if we fail to get the saved credential, log a warning
// but do not throw the GET error, as the error could be
// confusing to users
logger:=log.GetLogger(ctx)
logger.Warnf("Failed to get the existing credentials for %s: %v", registryName, err)
}
returnfmt.Errorf("failed to log in to %s: the credential could not be saved because a credentials store is required to securely store the password. See %s",
registryName, urlDocHowToAuthenticate)
}
where credsStore.Get() attempts to get the credential for docker.io, while the credential for docker.io is stored in the entry https://index.docker.io/v1/ (expected behavior), hence credsStore.Get("docker.io") returns an empty credential savedCred that does not match the provided credential cred.
A mapping from docker.io to https://index.docker.io/v1/ is required.
What did you expect to happen?
notation login should be able to detect the existing credentials for docker.io
What is the areas you experience the issue in?
Notation CLI
What is not working as expected?
On a machine without credentials store, after
![image](https://private-user-images.githubusercontent.com/8113721/242147847-f38cacbe-9e71-416c-84ba-35b07b1cea20.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzI5NDEsIm5iZiI6MTcyNTczMjY0MSwicGF0aCI6Ii84MTEzNzIxLzI0MjE0Nzg0Ny1mMzhjYWNiZS05ZTcxLTQxNmMtODRiYS0zNWIwN2IxY2VhMjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDdUMTgxMDQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTJmNjQzZGUzZTY3NTRiOWM5Y2UzMzliMWIyNGM1ZjQzZWU5ZDAzMmJkMDA5NTA2MTMzNzFlYWQxYTMwMWI3ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.mOuPbw3nduPJ1xbsDPkk4dMKtxtHWzgeJ1Ks6otw7uc)
docker login docker.io
succeeds,notation login
with the same credential should also succeed with a warning.However, it fails to detect the existing credential and throws an error:
![image](https://private-user-images.githubusercontent.com/8113721/242148052-285823f9-23e3-4890-95b4-f3d91d2171bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzI5NDEsIm5iZiI6MTcyNTczMjY0MSwicGF0aCI6Ii84MTEzNzIxLzI0MjE0ODA1Mi0yODU4MjNmOS0yM2UzLTQ4OTAtOTViNC1mM2Q5MWQyMTcxYmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDdUMTgxMDQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTE3Y2M0MzdhMDg5N2M0YzM2MTllZWYzMjZlNDA5ODE2ZDE3ZTZjZjE3NmM0NjhhNDhkZDVlMTJmNjZmMTkwOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.zc2eMy-rkwx_VTtL-Zg5KTwJ4j8k4QThr1QAeo_Uiqs)
The bug is at here:
notation/cmd/notation/login.go
Lines 118 to 128 in ebfb9ef
where
credsStore.Get()
attempts to get the credential fordocker.io
, while the credential fordocker.io
is stored in the entryhttps://index.docker.io/v1/
(expected behavior), hencecredsStore.Get("docker.io")
returns an empty credentialsavedCred
that does not match the provided credentialcred
.A mapping from
docker.io
tohttps://index.docker.io/v1/
is required.What did you expect to happen?
notation login
should be able to detect the existing credentials fordocker.io
Expected output:
![image](https://private-user-images.githubusercontent.com/8113721/242146140-7b908b4c-e254-4373-afc4-d9b629d38538.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzI5NDEsIm5iZiI6MTcyNTczMjY0MSwicGF0aCI6Ii84MTEzNzIxLzI0MjE0NjE0MC03YjkwOGI0Yy1lMjU0LTQzNzMtYWZjNC1kOWI2MjlkMzg1MzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDdUMTgxMDQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTljMWJhNjUyMDZlMWQ4YzAzNjk3Mzk0NTQyZTA5Y2YyMzZiOWM3NjcxNmNhYWE4ZTJmYzdiYmMyMGI2MWQ4MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.inn9kfhqKCXUE4lruH3TtfcmDpMO2RPje86WXuohiGw)
How can we reproduce it?
On a machine without credentials store,
Describe your environment
Windows 11/powershell
What is the version of your Notation CLI or Notation Library?
Version: 1.0.0-rc.7
Go version: go1.20.4
Git commit: ebfb9ef
The text was updated successfully, but these errors were encountered: