Skip to content

feat: support per-host scope hints#604

Merged
Wwwsylvia merged 29 commits into
oras-project:mainfrom
Wwwsylvia:fix_scope
Sep 27, 2023
Merged

feat: support per-host scope hints#604
Wwwsylvia merged 29 commits into
oras-project:mainfrom
Wwwsylvia:fix_scope

Conversation

@Wwwsylvia

@Wwwsylvia Wwwsylvia commented Sep 21, 2023

Copy link
Copy Markdown
Member

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

@Wwwsylvia Wwwsylvia marked this pull request as draft September 21, 2023 08:06
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go
@Wwwsylvia Wwwsylvia marked this pull request as ready for review September 21, 2023 09:07
Comment thread internal/maps/maps.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go
Comment thread registry/remote/auth/client.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
@codecov-commenter

codecov-commenter commented Sep 25, 2023

Copy link
Copy Markdown

Codecov Report

Merging #604 (e6fa97b) into main (2d371a0) will increase coverage by 0.32%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   74.46%   74.79%   +0.32%     
==========================================
  Files          59       58       -1     
  Lines        5275     5304      +29     
==========================================
+ Hits         3928     3967      +39     
+ Misses        993      985       -8     
+ Partials      354      352       -2     
Files Coverage Δ
content.go 72.85% <100.00%> (ø)
registry/remote/auth/client.go 73.12% <100.00%> (ø)
registry/remote/auth/scope.go 100.00% <100.00%> (ø)
registry/remote/registry.go 67.67% <100.00%> (ø)
registry/remote/repository.go 71.19% <100.00%> (ø)

... and 1 file with indirect coverage changes

@Wwwsylvia Wwwsylvia force-pushed the fix_scope branch 2 times, most recently from 79a6a97 to 8719d29 Compare September 26, 2023 03:29
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Comment thread registry/remote/auth/scope.go Outdated
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Wwwsylvia Wwwsylvia merged commit a428ca6 into oras-project:main Sep 27, 2023
@Wwwsylvia Wwwsylvia deleted the fix_scope branch September 27, 2023 02:58
Wwwsylvia added a commit that referenced this pull request Oct 20, 2023
Backporting 0f1dc30 to the release
branch.
This change does the same thing as the original commit (#618) did but
using the old `registryutil.WithScopeHint` instead of
`auth.AppendRepositoryScope`, which is introduced by #604 and is not
available in `v2.3.x`.

Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
@Wwwsylvia Wwwsylvia mentioned this pull request Jan 26, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: auth.AppendScopes does not distinguish between registries

5 participants