Skip to content

refactor!: reorganize auth and credential#1006

Merged
TerryHowe merged 4 commits intooras-project:mainfrom
TerryHowe:refactor-reorganize-auth-and-credential
Mar 9, 2026
Merged

refactor!: reorganize auth and credential#1006
TerryHowe merged 4 commits intooras-project:mainfrom
TerryHowe:refactor-reorganize-auth-and-credential

Conversation

@TerryHowe
Copy link
Copy Markdown
Member

@TerryHowe TerryHowe commented Sep 13, 2025

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.

  • Created configuration package for configuration file/directory parsing
  • Created properties package for remote registry properties that are agnostic to the source or use of the data

Partial: #836 (parses auth config json)

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 13, 2025

Codecov Report

❌ Patch coverage is 89.10891% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.40%. Comparing base (42c1a3a) to head (344be77).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...gistry/remote/internal/configuration/authconfig.go 65.00% 6 Missing and 1 partial ⚠️
registry/remote/credentials/credential.go 82.60% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch 2 times, most recently from f8e4d55 to 82bdb1e Compare September 13, 2025 14:26
@Wwwsylvia Wwwsylvia requested a review from Copilot October 10, 2025 11:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 auth package to credentials package
  • 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 shizhMSFT changed the title refactor: reorganize auth and credential refactor!: reorganize auth and credential Oct 10, 2025
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

This PR definitely introduces breaking changes and thus not suitable for the current v2 version.

@TerryHowe
Copy link
Copy Markdown
Member Author

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.

@TerryHowe TerryHowe changed the title refactor!: reorganize auth and credential refactor: reorganize auth and credential Oct 10, 2025
@TerryHowe
Copy link
Copy Markdown
Member Author

All those copilot comments were wrong #1020 would probably help

@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch from 7fecafc to 4fcbfd2 Compare October 11, 2025 18:31
@Wwwsylvia Wwwsylvia changed the title refactor: reorganize auth and credential refactor!: reorganize auth and credential Oct 13, 2025
@Wwwsylvia
Copy link
Copy Markdown
Member

Yes. Do you want to target another branch?

@shizhMSFT @TerryHowe Should we create a v3 branch? But we’d need to sync bug fixes and features into it going forward. I'm not sure if now is the right time.

@Wwwsylvia
Copy link
Copy Markdown
Member

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.

There are only two fixes: v2.6.0...main
Does it block Helm?

@Wwwsylvia Wwwsylvia requested a review from Copilot October 20, 2025 08:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated no new comments.

@TerryHowe TerryHowe changed the title refactor!: reorganize auth and credential refactor: reorganize auth and credential Oct 25, 2025
@TerryHowe TerryHowe changed the title refactor: reorganize auth and credential refactor!: reorganize auth and credential Oct 25, 2025
@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch 2 times, most recently from b12730d to d4d4d1a Compare October 25, 2025 18:57
@TerryHowe
Copy link
Copy Markdown
Member Author

The last commit consolidates all the AuthConfig logic to that one file in internal/configuration

@Wwwsylvia Wwwsylvia requested a review from Copilot November 8, 2025 08:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 24 out of 36 changed files in this pull request and generated 1 comment.

@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch from c7b03a6 to 254f3f6 Compare November 14, 2025 13:56
@TerryHowe TerryHowe added the v3 Things belongs to version 3.x label Nov 17, 2025
@TerryHowe TerryHowe added this to the v3.0.0 milestone Nov 17, 2025
@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch 2 times, most recently from 511878b to 50fad72 Compare November 23, 2025 18:46
@TerryHowe
Copy link
Copy Markdown
Member Author

Last push was just a rebase and fixed conflicts

@shizhMSFT
Copy link
Copy Markdown
Contributor

@TerryHowe They are PRs depending each other. Could you suggest the order of PR to be reviewed?

@TerryHowe
Copy link
Copy Markdown
Member Author

@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch from 50fad72 to d0d9999 Compare December 21, 2025 16:30
@TerryHowe TerryHowe requested a review from sabre1041 as a code owner December 21, 2025 16:30
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe TerryHowe force-pushed the refactor-reorganize-auth-and-credential branch from d0d9999 to 21110b4 Compare December 21, 2025 16:32
@TerryHowe TerryHowe requested a review from shizhMSFT December 27, 2025 18:12
Copy link
Copy Markdown
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

Looks good. One small change requested as there is a documentation reference that needs to be updated

TerryHowe and others added 2 commits January 4, 2026 05:32
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>
Copy link
Copy Markdown
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

TerryHowe added a commit to TerryHowe/oras-go that referenced this pull request Feb 17, 2026
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe TerryHowe merged commit a85e22f into oras-project:main Mar 9, 2026
6 checks passed
TerryHowe added a commit that referenced this pull request Mar 10, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 Things belongs to version 3.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants