Skip to content

Add support for operator in SigningConfig #494

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

Conversation

haydentherapper
Copy link
Contributor

@haydentherapper haydentherapper commented Jun 30, 2025

The v0.2 signing config includes an Operator field so that clients will select Services from distinct operators. This PR adds support for the Operator field, where multi-service selection will select distinct instances. Later, we'll add support for the Operator field for instances declared in the trusted root, to verify that instances from the same operator do not all count towards meeting a threshold.

Since the v0.2 signing config is only distributed via the staging TUF repo, I've left the example as-is for now, since any integrators will need to declare their signing config manually for production.

@haydentherapper haydentherapper requested a review from a team as a code owner June 30, 2025 23:20
sortedVersions := make([]uint32, len(supportedAPIVersions))
copy(sortedVersions, supportedAPIVersions)
slices.Sort(sortedVersions)
slices.Reverse(sortedVersions)

// Order services from newest to oldest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, this would select the first service in the list, rather than the newest. This assumed that signing configs were pre-sorted. In practice (or at least for PGI), they should be, but I've added this explicitly to prevent unexpected selections. These sorts shouldn't be inefficient since the number of services should be limited.

func GetSigningConfig(c *tuf.Client) (*SigningConfig, error) {
jsonBytes, err := c.GetTarget("signing_config.json")
jsonBytes, err := c.GetTarget("signing_config.v0.2.json")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a breaking change? The comment says it's for PGI but it looks like this could be used with any TUF mirror?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While it could be used for any TUF mirror, this shouldn't be a breaking change because we intend for this function to only be used with PGI. It should be invisible to users whether the signing config (or trusted root) is coming from a later revision, which is what this function is designed for.

I reverted this change though because it will break if GetSigningConfig is used against the production TUF repo. Tracking updating this in #495.

@haydentherapper haydentherapper force-pushed the operator-signing-config branch from cb53720 to 6d1bd46 Compare July 1, 2025 18:35
The v0.2 signing config includes an Operator field so that clients will
select Services from distinct operators. This PR adds support for the
Operator field, where multi-service selection will select distinct
instances. Later, we'll add support for the Operator field for instances
declared in the trusted root, to verify that instances from the same
operator do not all count towards meeting a threshold.

Since the v0.2 signing config is only distributed via the staging TUF
repo, I've left the example as-is for now, since any integrators will
need to declare their signing config manually for production.

Signed-off-by: Hayden B <[email protected]>
@haydentherapper haydentherapper force-pushed the operator-signing-config branch from 6d1bd46 to e15139c Compare July 1, 2025 18:40
@haydentherapper haydentherapper requested a review from steiza July 1, 2025 18:54
@haydentherapper haydentherapper merged commit df24b2d into sigstore:main Jul 2, 2025
12 checks passed
@haydentherapper haydentherapper deleted the operator-signing-config branch July 2, 2025 14:42
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.

3 participants