feat: expose ClientTrustConfig as a public class#1496
Conversation
8ec76df to
692955d
Compare
|
Noticed the rekorV2 tests are wishy washy |
If you mean that the signing tests using staging rekor2 fail with 50x errors more often then is reasonable: yes this seems to be the case. I'm following up in sigstore/rekor-tiles repo |
692955d to
fc1630e
Compare
|
sizeable new main commit; rebased pr |
|
/gcbrun |
|
Thanks @SequeI! Exposing this as public makes sense to me. Two thoughts:
|
a13895d to
a700c31
Compare
|
@SequeI Could you avoid force-pushing unless absolutely necessary? It causes a notification to me (and presumably anything one else subscribed on the PR) each time you do 🙂 (It's okay to have a non-clean history on this PR -- we'll clean it up with the actual merge.) |
|
@woodruffw Apologies! Won't do that anymore Would it make sense to have a new public module (trust like previously) and just expose trustedRoot and SigningConfig alongside ClientTrustConfig due to it's dependence on it? Putting it into models creates a lot of circular import errors with rekor and rekorv2 unfortunately |
Hmm, could you paste those? I think we'd ideally eliminate those potential circularities are part of v4 anyways; they should all be refactorable. |
|
Sure : I wasn't sure if this would be in the scope of the PR, or if I should fix this etc, but I'll fix these in this case |
Thank you! Yes, I'd consider it in scope, and I appreciate you fixing them 🙂 |
|
Resolved; I had thought it would be much more involved but was just a small issue with RekorV1/V2 placement |
I agree with this goal but I'm not sure exposing just TrustConfig is that useful: this PR in practice also makes TrustedRoot and SigningConfig public (since they are available through TrustConfig properties, and we expect users to uses those properties) but now those two classes still live in Maybe that's not too bad since the only thing we expect users to do with TrustedRoot/SigningConfig is to provide them to other sigstore components as arguments? |
@jku Not sure about other use cases, but the ClientTrustConfig is the only things required in |
jku
left a comment
There was a problem hiding this comment.
I've been avoiding reviewing since both of these feel like code smells:
- ClientTrustConfig is moved to models and SigningConfig/TrustedRoot remain in _internal -- all of them are essentially public API now though
- the import within function
That said, I've tried to come up with better solutions and so far have no better ideas: API publicity was discussed already and the import trick seems required if we want to keep the rekor client selection a SigningConfig implementation detail.
so I'm happy with this. @woodruffw do you want to have another look?
|
Any further communication regarding this PR? I don't mind changing anything if it would make better sense for the codebase |
I think we have two options here:
I don't have a strong preference between these -- (1) is probably simpler but we'll likely want to do (2) eventually anyways so maybe we should just get it out of the way.
Yeah, I don't love this -- I (personally) find function-scoped imports to be a code smell and much harder to debug (since they modify global import state "late" in execution). I'm OK with merging here if there's no clean solution, but I'd like to better understand where the import cycle is here so that we can eventually fix it. |
Promote TrustedRoot, SigningConfig, and ClientTrustConfig to the public API via sigstore.models Signed-off-by: SequeI <asiek@redhat.com>
3ff7492 to
b95d199
Compare
|
Apologies for the force push, just easiest to do being 20 commits behind main etc. I have moved over the appropriate classes to sigstore._internal.rekor.client import RekorClient This is being hit due to I have included a lazy import within the PR for now, just so it works and we can open an issue for this, or if you have any insight since you are much more experienced with this codebase, fix it within this PR. |
|
/gcbrun |
|
I have filed an issue on the deferred import and will merge this as is. Thanks! |
Summary
Exposing ClientTrustConfig. Since recent changes to SigningContext.staging/production being moved to ClientTrustConfig, it would be better for this class to be public as it is/will be used in Model-Transparency and such. The API has had massive changes as is, so I think it would be better doing this now for next release.
Resolves #1019
Release Note
Added to changelog.md
The ClientTrustConfig class has been moved from the private _internal package to a new public
module (sigstore.trust). This change formally adds the class to the project's public API,
making it available for use in other projects.