Skip to content

Adds a Tuf local store abstraction and a file based implementation #149

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

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

patflynn
Copy link
Collaborator

TUF local repo store sets us up to be able to use an in-memory implementation for read-only file system scenarios.

Progress towards #60

Signed-off-by: Patrick Flynn [email protected]

@vlsi
Copy link
Collaborator

vlsi commented Sep 14, 2022

@patflynn , what do you think of putting "abstractions" into sigstore-testkit folder?

They might be useful across more than a single module, and I'm inlined it might be slightly better if src/test includes code with @Test methods "only".

@patflynn
Copy link
Collaborator Author

@vlsi You're suggesting putting the TestResources into testkit? I like the idea. This was the rule at Google too. It's a bit tricky in this case because I would have to move the associated resource data, which I like a little less from a navigatability standpoint for test maintainers.

@vlsi
Copy link
Collaborator

vlsi commented Sep 14, 2022

It's a bit tricky in this case because I would have to move the associated resource data

That is right, however, reading files from src/... might be not the best idea.

WDYT of using Class.getResource(...)?
Then TestResources could take Class<> argument, and it could use that to lookup the resources.
An alternative option is to use com.google.common.io.Resources#getResource(java.lang.Class<?>, java.lang.String)

@patflynn
Copy link
Collaborator Author

Yeah that makes sense. I was avoiding it initially because the API itself doesn't read resources from the class path as the local repo and trusted root can be anywhere on the filesystem, but I should be able to bridge that.

@patflynn
Copy link
Collaborator Author

This does get a little nasty though as circular deps are going to rare their ugly heads :). These test support classes will be quite limited since they won't be able to use any sigstore-java types unless we break the tests out into a separate module..

@vlsi
Copy link
Collaborator

vlsi commented Sep 14, 2022

These test support classes will be quite limited since they won't be able to use any sigstore-java types

I do not follow you here. sigstore-testkit dependency on sigstore-java is just fine.

@patflynn
Copy link
Collaborator Author

Aha! You're right. That's great! I guess Gradle doesn't include the test deps when testing module cycles. GTK.

@vlsi
Copy link
Collaborator

vlsi commented Sep 14, 2022

I guess Gradle doesn't include the test deps when testing module cycles. GTK.

Depending on "test" artifacts is weird, and Gradle does not provide out-of-the-box to "depend on files from src/test/..."

Here's a sample where calcite-testkit depends on calcite-core: https://github.com/apache/calcite/blob/e41555f568510df04d3883516b2195393a93426d/testkit/build.gradle.kts#L22, and it works great.

@patflynn
Copy link
Collaborator Author

@vlsi PTAL

@patflynn patflynn force-pushed the local-tuf-store-abstraction branch from 7b29523 to e6f844b Compare September 14, 2022 17:35
@patflynn patflynn merged commit 6b33e02 into main Sep 14, 2022
@patflynn patflynn deleted the local-tuf-store-abstraction branch September 14, 2022 20:35
@patflynn
Copy link
Collaborator Author

patflynn commented Oct 11, 2022 via email

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.

2 participants