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

make cache injectable into NotaryRepository #998

Merged
merged 1 commit into from
Oct 12, 2016

Conversation

endophage
Copy link
Contributor

@endophage endophage commented Oct 7, 2016

Reasonably minimal changes to make cache injectable while not having to move around much code. Also want to keep and add to "helper" constructors (e.g. NewFileCachedNotaryRepository) rather than push too much of that code up the call stack.

Also moved a bunch of errors that were in client/client.go into a new client/errors.go to keep things a little cleaner. client/client.go was a bit messy with a bunch of error types. They're still in the same scope (i.e. in the client package) so nothing else had to be changed by moving them.

Signed-off-by: David Lawrence [email protected] (github: endophage)

Signed-off-by: David Lawrence <[email protected]> (github: endophage)
Copy link
Contributor

@riyazdf riyazdf left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for tackling this!

@riyazdf
Copy link
Contributor

riyazdf commented Oct 12, 2016

also as a breadcrumb, this partially addresses #932

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for tackling this and also cleaning up the errors!

retriever notary.PassRetriever, trustPinning trustpinning.TrustPinConfig) (
*NotaryRepository, error) {

func getKeyStores(baseDir string, retriever notary.PassRetriever) ([]trustmanager.KeyStore, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking: It might be nice to make these exportable; the CLI has a function that basically replicates this for listing keys, etc, and it would be awesome to replace it with these. Can be done in a separate PR though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@endophage endophage merged commit 286395f into notaryproject:master Oct 12, 2016
@endophage endophage deleted the inject_cache branch October 12, 2016 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants