Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error type for not finding basic auth creds and export config path #674

Merged
merged 15 commits into from
Jan 17, 2024

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Jan 9, 2024

Two changes proposed in this PR

  1. When failed to fetch credentials for basic auth, return a new error
  2. Add a new function to DynamicStore

An example usage of the proposed change: oras-project/oras#1235, resolves #676

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3b1dd0e) 75.71% compared to head (f1d1a3d) 75.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #674      +/-   ##
==========================================
+ Coverage   75.71%   75.78%   +0.06%     
==========================================
  Files          59       59              
  Lines        5765     5769       +4     
==========================================
+ Hits         4365     4372       +7     
+ Misses       1028     1026       -2     
+ Partials      372      371       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

registry/remote/credentials/store.go Outdated Show resolved Hide resolved
errdef/errors.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah marked this pull request as ready for review January 11, 2024 11:17
registry/remote/auth/client.go Show resolved Hide resolved
registry/remote/credentials/internal/config/config.go Outdated Show resolved Hide resolved
registry/remote/credentials/store.go Show resolved Hide resolved
registry/remote/credentials/store.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM.

@Wwwsylvia
Copy link
Member

I think this change is a feat instead of a chore as it introduces public types and methods.

@qweeah qweeah changed the title chore(ux): export a new error type for not finding basic auth creds feat: export a new error type for not finding basic auth creds Jan 12, 2024
@qweeah qweeah changed the title feat: export a new error type for not finding basic auth creds feat: error type for not finding basic auth creds and export config path Jan 12, 2024
registry/remote/auth/client.go Show resolved Hide resolved
registry/remote/credentials/store.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

Choose a reason for hiding this comment

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

LGTM with a nit suggestion

registry/remote/auth/client.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Copy link
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.

LGTM

Copy link
Member

@Wwwsylvia Wwwsylvia left a comment

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 d8783fe into oras-project:main Jan 17, 2024
9 checks passed
@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.

add exported function to get the path of a DynamicStore's underlying config file
3 participants