refactor!: reorganize auth and credential#1006
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1006 +/- ##
==========================================
- Coverage 82.59% 82.40% -0.19%
==========================================
Files 64 66 +2
Lines 4779 4791 +12
==========================================
+ Hits 3947 3948 +1
- Misses 509 519 +10
- Partials 323 324 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f8e4d55 to
82bdb1e
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the authentication and credential management system in oras-go by reorganizing the package structure to make auth dependent on credentials instead of the other way around.
- Moved credential types and functions from
authpackage tocredentialspackage - Updated all imports and references to use the new package structure
- Consolidated example functions to avoid duplication
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| registry/remote/example_test.go | Added credential store example functions moved from the credentials package |
| registry/remote/credentials/trace/example_test.go | Updated import path and credential type reference |
| registry/remote/credentials/store_test.go | Added testStore implementation and updated all credential type references |
| registry/remote/credentials/store.go | Updated import paths and credential type references |
| registry/remote/credentials/native_store_test.go | Updated credential type references throughout test cases |
| registry/remote/credentials/native_store.go | Updated credential type references and removed auth package import |
| registry/remote/credentials/memory_store_test.go | Updated credential type references throughout test cases |
| registry/remote/credentials/memory_store_from_config_test.go | Updated credential type references and import paths |
| registry/remote/credentials/memory_store.go | Updated credential type references and removed auth package import |
| registry/remote/credentials/file_store_test.go | Updated credential type references and import path |
| registry/remote/credentials/file_store.go | Updated credential type references and removed auth package import |
| registry/remote/credentials/example_test.go | Removed entire file (examples moved to remote package) |
| registry/remote/credentials/credential_test.go | Added comprehensive tests for new credential types and functions |
| registry/remote/credentials/credential.go | Moved from auth package, now contains core credential types and functions |
| registry/remote/credentials/config_test.go | Updated package declaration and all credential type references |
| registry/remote/credentials/config.go | Updated package declaration and credential type references |
| registry/remote/auth_test.go | Updated package declaration and credential type references |
| registry/remote/auth/example_test.go | Updated import paths and credential type references |
| registry/remote/auth/client_test.go | Updated credential type references throughout |
| registry/remote/auth/client.go | Updated credential type references and removed duplicate functions |
| registry/remote/auth.go | Updated package declaration and credential type references |
| example_test.go | Updated credential type references in examples |
| example_copy_test.go | Updated credential type references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
shizhMSFT
left a comment
There was a problem hiding this comment.
This PR definitely introduces breaking changes and thus not suitable for the current v2 version.
Yes. Do you want to target another branch? Also, it would be convenient to have a patch release of oras-go since there are a couple unreleased fixes that would be nice to have out there. |
|
All those copilot comments were wrong #1020 would probably help |
7fecafc to
4fcbfd2
Compare
@shizhMSFT @TerryHowe Should we create a |
There are only two fixes: v2.6.0...main |
b12730d to
d4d4d1a
Compare
|
The last commit consolidates all the AuthConfig logic to that one file in internal/configuration |
c7b03a6 to
254f3f6
Compare
511878b to
50fad72
Compare
|
Last push was just a rebase and fixed conflicts |
|
@TerryHowe They are PRs depending each other. Could you suggest the order of PR to be reviewed? |
50fad72 to
d0d9999
Compare
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
d0d9999 to
21110b4
Compare
sabre1041
left a comment
There was a problem hiding this comment.
Looks good. One small change requested as there is a documentation reference that needs to be updated
Co-authored-by: Andrew Block <andy.block@gmail.com> Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Co-authored-by: Andrew Block <andy.block@gmail.com> Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Add support for registries.conf. This is not a full implementation it'll be a follow-up PR with more features for the file. This does contain basic support though. Based on https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md More detail https://man.archlinux.org/man/containers-registries.conf.5.en This PR depends on #1006 Closes: #918 Closes: #1058 --------- Signed-off-by: Terry Howe <terrylhowe@gmail.com>
I have some features/changes I'd like to make to oras-go and this relationship between auth and credentials often gets in the way. This change makes auth dependent on credentials instead of the other way around.
Partial: #836 (parses auth config json)