-
Notifications
You must be signed in to change notification settings - Fork 110
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: Adds a new raw file metadata storage for clients #347
feat: Adds a new raw file metadata storage for clients #347
Conversation
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.
Thanks, this LGTM.
It would be great to get a review from a maintainer who is more fluent in Go than I am.
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.
The change looks good to me as a start, but I wonder a few things and would love feedback:
Do we need a lock mechanism, esp for SetMeta()? If there are more than one client accessing the store.
Yeah, let me add version that's safe for concurrent use! |
I added a new wrapper, |
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
…ository side. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Changed package to client to align with leveldb storage. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Fixed spelling error found during review. Co-authored-by: Joshua Lock <jlock@vmware.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
4dfab89
to
61c7323
Compare
…ace. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Co-authored-by: Ethan Lowman <53835328+ethan-lowman-dd@users.noreply.github.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Co-authored-by: Ethan Lowman <53835328+ethan-lowman-dd@users.noreply.github.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Co-authored-by: Ethan Lowman <53835328+ethan-lowman-dd@users.noreply.github.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Co-authored-by: Ethan Lowman <53835328+ethan-lowman-dd@users.noreply.github.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Moved IsMetaFile to new pkg, internal/fsutil Permission bits are validated when access the cache. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Windows tests are failing, I will look into this tomorrow. |
The failing tests are due to filesystem permission, which on Windows is very different from UNIX-like operating system.
And this seems to be correct according the source code: https://github.com/golang/go/blob/master/src/syscall/syscall_windows.go#L307 It seems that there are some ACL concept in Windows that we can rely on. But I'm not qualified to speak if the normal permission modes set (all-read or all-write) actually are system-wide or if the effective permission applies to the user only. I found this ACL implementation in go: https://github.com/hectane/go-acl As this feature of verifying the filesystem permission bits, is new for this implementation (LevelDB implementation does not care), nor is there any guidance for implementors of Please advise on how to proceed. |
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
@trishankatdatadog Of course! Created this: #360 |
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
be33028
to
39f4018
Compare
Co-authored-by: Ethan Lowman <53835328+ethan-lowman-dd@users.noreply.github.com> Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Mostly minor things like removing sentinel errors, wrapping errors from std library. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Good feedback @ethan-lowman-dd, all your comments should be addressed now 👍 |
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
Nice work, thanks Ethan |
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.
Lovely work here @kommendorkapten and @ethan-lowman-dd , thank you!
@kommendorkapten would you please rebase and resolve conflicts? thx! |
Was off on PTO, so didn't see you message @trishankatdatadog until now. PR is updated now. |
Thanks! Would you pls fix the linting errors? |
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
210b417
Sorry, was not aware of them, fixed now. |
This came up during a discussion related to new features for the sigstore TUF client, as there is a desire to make implementations in different languages sharing the target and metadata cache.
Release Notes: Possibility to store metadata files as raw JSON files to allow for interoperability with other TUF implementations.
Types of changes:
Description of the changes being introduced by the pull request:
This pull request introduces a new implementation of the client's
LocalStore
interface. This storage stores the metadata files are regular files in a provided directory. This would improve compatibility to share metadata cache between different language implementations.Please verify and check that the pull request fulfills the following requirements: