oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
86 stars 45 forks source link

Refactor auth - add re-auth mechanism #111

Closed aviramha closed 5 months ago

aviramha commented 5 months ago

Sorry about the spam! This builds upon the other 2 PRs #109 #110 Just out of comfort assuming if merged I'll work on it serially. This adds logic to enable token re-creation when needed, and also making the auth API more fluent. I had a situation where my token got expired mid-upload and there was no place to renew, and if I could break the API I'd have structured it a bit different, but I think is ok.

flavio commented 5 months ago

@aviramha can you please look into the unit tests that are failing? I can reproduce the failures locally, and they are a regression introduced by this PR

aviramha commented 5 months ago

Sure! I had an assumption those tests require auth. Fixed now.