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
This code snippet adds both pull and push scope hints to ctx for the dst repository in order to decrease the number of auth requests on dst in the later copy operation.
However, auth.AppendScopes does not distinguish scopes between registries, resulting in pull and push scopes being requested for both src and dst repository, which is not safe.
The text was updated successfully, but these errors were encountered:
The purpose of this PR is to fix the bug, but new APIs are needed to
avoid breaking changes.
1. Introduce `auth.WithScopesForHost`
2. Introduce `auth.AppendScopesForHost`
3. Introduce `auth.GetScopesForHost` and `auth.GetAllScopesForHost`
4. Introduce `auth.AppendRepositoryScope`
Resolves: #581
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
When copying an artifact from a remote repository to another, we may code something like below:
This code snippet adds both
pull
andpush
scope hints toctx
for thedst
repository in order to decrease the number of auth requests ondst
in the later copy operation.However,
auth.AppendScopes
does not distinguish scopes between registries, resulting inpull
andpush
scopes being requested for bothsrc
anddst
repository, which is not safe.The text was updated successfully, but these errors were encountered: