Repository navigation
refactor!: consistent function and feature names before 1.0 - #319
Merged
Merged
Conversation
- trust-root: name optional dependencies with dep: in the tuf feature, so sigstore-tuf, tokio and directories are no longer implicit public features. - sign: SigningServices::embedded -> from_embedded, matching TrustedRoot and SigningContext; from_tuf_config(_with_rekor_version) -> from_signing_config(_with_rekor_version), since it takes a SigningConfig rather than a TufConfig. - oidc: OAuthClient::auth(_with_options) -> authenticate(_with_options), matching SigningContext::authenticate; the free get_identity_token -> authenticate; remove parse_identity_token, a duplicate of IdentityToken::from_jwt. - rekor: RekorV2Client gets a builder like RekorClient, replacing the static with_http_client(url, client) constructor. - bundle: TlogEntryBuilder setters take the with_ prefix used by every other builder. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Wolf Vollprecht <w.vollprecht@gmail.com>
Member
no strong opinions on any of these, nothing seems that important |
This was referenced Oct 8, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a naming review across all published crates, done on top of #316 and #317. It covers Cargo features and public function names. It fixes the clear inconsistencies and lists judgment calls at the end.
Features
Feature names are already consistent. All crates use
rustlsandnative-tls.clientis the optional HTTP layer (rekor, tsa, and tuf after #317),tuffetches trust roots (trust-root, sign, verify), andbrowseris in oidc and sign. One leak:tuffeature named its optional dependencies withoutdep:. That silently created public features calledsigstore-tuf,tokioanddirectories, which we would have had to keep for all of 1.x. They now usedep:.I checked
cargo checkfor every published crate with no default features, withrustlsonly, withnative-tlsonly, and with defaults. I also checkedtuf,clientandbrowseron their own. All of them build without warnings.Renames
SigningServices::embeddedfrom_embeddedTrustedRoot::from_embeddedandSigningContext::from_embeddedSigningServices::from_tuf_config(_with_rekor_version)from_signing_config(_with_rekor_version)SigningConfig, not aTufConfigOAuthClient::auth/auth_with_optionsauthenticate/authenticate_with_optionsSigningContext::authenticateget_identity_token(url)authenticate(url)get_hidesparse_identity_tokenIdentityToken::from_jwtRekorV2Client::with_http_client(url, client)RekorV2Client::builder(url).with_http_client(client).build()with_http_clienttakesself. This one was a static constructor. It now has a builder likeRekorClientTlogEntryBuilder::{log_index, integrated_time, inclusion_promise, inclusion_proof}with_*with_Left as is, open for discussion
get_*on network clients: Fulcioget_configuration, Rekorget_entry_by_uuid/get_checkpoint/get_tile, and TUFget_target(_info)are HTTP GETs, and they're named the same way across crates.VerificationPolicy::verify_tlog()andPublicKeyVerificationPolicy::verify_tlog(): these areboolgetters, but the names read like actions.verifies_tlog()would be clearer. I didn't rename them here because refactor(verify)!: collapse verification entry points #316 touches the same code.Keyring::get_key/get_key_at/get_key_started_by(crypto): these are local lookups, so Rust's getter convention would name themkey/key_at/key_started_by.sha384()(crypto): returnsVec<u8>, whilesha256()andsha512()return typed hashes. There's noSha384Hashtype yet.OAuthClient,HttpRepository,TufConfigandSigningContexttakewith_http_client(self, ..)on the type itself. Each pattern is consistent within its crate, and both are common in Rust.Testing
clippy --workspace --all-targets --all-features -D warningsand rustdoc with-D warningsare clean.Signed-off-by: Wolf Vollprecht w.vollprecht@gmail.com
🤖 Generated with Claude Code