Skip to content

feat(cli): read Sigstore sign/verify settings from client context - #2260

Merged
akijakya merged 2 commits into
mainfrom
feat/sigstore-context-config
Oct 6, 2026
Merged

akijakya merged 2 commits into
mainfrom
feat/sigstore-context-config

Conversation

@akijakya

@akijakya akijakya commented Oct 1, 2026

Copy link
Copy Markdown
Member

Adds a per-context sigstore section to the dirctl client config, so a context can point keyless signing and OIDC verification at a self-hosted Sigstore stack instead of passing every URL and trust flag on each call.

contexts:
  corp:
    server_address: dir.corp.example:443
    sigstore:
      fulcio_url: https://fulcio.corp.example
      timestamp_url: https://tsa.corp.example/api/v1/timestamp
      skip_tlog: true
      oidc_provider_url: https://idp.corp.example
      trusted_root_path: /etc/dirctl/corp-trusted-root.json
      ignore_tlog: true
      ignore_sct: true
  • Each key can also be set with a DIRECTORY_CLIENT_SIGSTORE_<KEY> environment variable. Precedence: explicit flag, env, context, built-in default. Flags only win when explicitly passed, since their defaults are the public-good URLs.
  • Applies to dirctl sign, push --sign, import --sign and verify. Key-based signing skips Sigstore resolution.
  • Resolved values go into a copy rather than the package-level option globals, so a configured value can't leak into a later in-process invocation. sign.Sign now takes the resolved *Options.
  • sigstore.oidc_client_id is separate from the context's top-level oidc_client_id used by dirctl auth login. The OIDC client secret and token stay flag-only.
  • A context without the section is saved exactly as before.
  • Docs: new "Sigstore settings" section in the CLI reference.

Tested with unit tests for config/env resolution and per-command precedence, and a smoke test of the built binary confirming the Fulcio URL is taken from config, env and flag in turn.

Closes #2256

@akijakya
akijakya requested a review from a team as a code owner October 1, 2026 14:48
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Oct 1, 2026
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

@muscariello muscariello left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this Andras. The precedence model (explicit flag, then env, then context, then default) is clear, and copying opts instead of mutating the package global fixes a real leak between invocations. Keeping the OIDC secret and token out of the config file is the right call.

I have one request and a few smaller suggestions, mostly inline.

Requested change: the new ignore_*, trusted_root_path and tuf_mirror_url settings can now relax dirctl verify from a context or an environment variable. Nothing tells the user when that happens (see the inline comment on resolveOIDCOptions).

CI is green. The Codecov gaps are the command wiring (inline comment on push.go).

Comment thread cli/cmd/verify/options.go Resolved
Comment thread docs/content/dir/dir-cli-reference.md Resolved
Comment thread client/config/config.go Resolved
Comment thread cli/config/sigstore.go Resolved
Comment thread client/config/sigstore.go Resolved
Comment thread cli/cmd/push/push.go Resolved
Comment thread cli/cmd/verify/options_test.go Resolved
@akijakya
akijakya force-pushed the feat/sigstore-context-config branch from ae46668 to 2930d7b Compare October 5, 2026 10:28
@github-actions github-actions Bot added size/L Denotes a PR that changes 1000-1999 lines and removed size/M Denotes a PR that changes 200-999 lines labels Oct 5, 2026
@akijakya

akijakya commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review. I've addressed all the inline comments in the latest push, including context show (done here rather than as a follow-up). The last one is answered in its thread.

@muscariello muscariello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@akijakya
akijakya added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit bec5b89 Oct 6, 2026
37 checks passed
@akijakya
akijakya deleted the feat/sigstore-context-config branch October 6, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 1000-1999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dirctl: read Sigstore sign/verify settings from the client config context

3 participants