-
Notifications
You must be signed in to change notification settings - Fork 512
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
Notary client refactor - simpler reader interface #1377
Conversation
(Test issues are due to GAS being renamed - I’ll fix that in a separate PR) |
client/interface.go
Outdated
// Repository represents the set of options that must be supported over a TUF repo. | ||
// Reader represents the set of options that must be supported over a TUF repo for | ||
// reading | ||
type Reader interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if there is a better name than Reader
as that usually means an io.Reader
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to name it something else. Alternately we could just make those methods that take a TUF repo instead of having a wrapper
3b71249
to
88698de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is great.
I agree with @justincormack's comment on Reader
, maybe call it ReadOnly
? Then one would be doing something like
import "github.com/theupdateframework/notary/client"
...
client.NewReadOnly(...)
When combined with the package name I think it's very clear semantics.
88698de
to
ad5ee33
Compare
Thanks for the feedback @justincormack and @endophage! Renamed to |
ad5ee33
to
8f41690
Compare
8f41690
to
4096cf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big 👍 for this change!
// Repository represents the set of options that must be supported over a TUF repo. | ||
// ReadOnly represents the set of options that must be supported over a TUF repo for | ||
// reading | ||
type ReadOnly interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
…loader that may be easier to use for clients that do not need any publishing capabilities. Signed-off-by: Ying Li <[email protected]>
4096cf4
to
c6360bf
Compare
🎉 /cc @tiborvass @anusha-ragunathan this one's merged |
Refactor the notary client library to have a separate reader and loader that may be easier to use for clients that do not need any publishing capabilities.
Originally proposed something similar in #968 - this just makes it easier to set up a downloading client that can read to an in-memory cache, or just something that will load from cache without having to provide a CryptoService, etc.
The plan is, if this PR passes design and code review, for a new PR converting all the
client_update_tests
to just use theLoadTUFRepo
function and an in-memory cache.cc @justincormack